Upgrade from 7.9 to 7.10

For the full release notes, head over to Fonto 7.10.0

Required changes

Fonto Development Tools

The minimum version of Node.js required by the Fonto Development Tools (FDT) has been increased to 10.13.0 in response to version 8 being declared end-of-life.

Whitespace handling in Fonto

When XML is loaded in Fonto, the editor always assumes that all whitespace in the loaded document is significant. While this is a safe position to take - not all schemas properly define in which elements whitespace is or is not significant - it can make interop with other XML editors or other tooling more difficult. In particular, pretty-printed XML saved by a source-level XML editor can cause unwanted whitespace to show up in Fonto, and whitespace entered in Fonto may not always be preserved after converting XML to another format (such as HTML) for publication.

To solve this problem, starting from this release Fonto will prevent users from inserting whitespace that is at risk of being removed or collapsed by other tooling. In particular, this concerns whitespace at the start or end of an element, as well as sequences of two or more adjacent whitespace characters. When existing content containing such whitespace is edited, Fonto will automatically remove whitespace in elements that are edited. Fonto will not automatically clean up full documents on load, as this would cause unexpected saves and may potentially introduce large changes that will show up in contexts such as Document History.

We recommend that partners who use other tooling in addition to Fonto to edit XML - or who already experience whitespace-related issues - implement a content conversion such that whitespace in the unsafe positions mentioned above is automatically removed or collapsed before the XML is presented to Fonto Editor or related apps such as Fonto Document History. This, in combination with the changes in Fonto 7.10, will make sure that any whitespace in Fonto documents can always safely be considered significant.

By default, Fonto will use the schema and editor configuration to determine elements in which all whitespace should be preserved. In particular, this means all elements that have the xml:space attribute (or its default or fixed value in the schema) set to "preserve", elements with a simpleType where the whiteSpace facet is set to "preserve" or elements configured using a family that supports the withNewlineBreakToken option and have it set. In cases where this information is wrong or insufficient, and modifying the schema is not possible, the new whitespace CVK property can be set to override the automatic behavior.

For more information, please refer to our guide on Whitespace Handling.

The enable-experiment/render-all-whitespace @ fontoxml-templated-views/src/setdefaultconfiguration.js configuration value has now been deprecated and will be removed in a future release. Some implementations may have previously set this to false to make Fonto use an older (incorrect) implementation of whitespace rendering that displayed any whitespace characters as spaces, reducing the visual impact. We now recommend always filtering out such unwanted whitespace at the CMS.

Schema changes

We've fixed a bug regarding default attribute values and added support for namespace restrictions on xs:any content models. This means that schemas used in Fonto need to be recompiled for use in 7.10.

Fonto Review

The Fonto Review backend application now has required configuration. For more information, see the Fonto Review documentation.

Recommended changes

Structure view API moved to fontoxml-families and fontoxml-structure

The structure view configuration API has moved from the fontoxml-structure-view add-on package to fontoxml-families and fontoxml-structure. While the fontoxml-structure-view package continues to provide the structure view sidebar, we deprecated the old locations for configureasstructureviewitem @ fontoxml-families/src/configureasstructureviewitem.js and the structureview @ fontoxml-structure/src/structureview.jsx component. We recommend that you update imports for these in your application to reflect the new locations. Applications that did not previously configure the structure view should consider adding this configuration (using configureasstructureviewitem @ fontoxml-families/src/configureasstructureviewitem.js), as this is now also used in Find & Replace.

Automatic capitalization

We have introduced a new CVK config variable, named allowAutocapitalization, to control automatic capitalization inside elements.

The valid values are:

  • true – The auto capitalization is applied in these elements and all children that are also or

  • false – The auto capitalization is not applied in this element and all children that are also or .

  • undefined – No decision was made for this node, the value for the nearest ancestor with this setting is used. This is the value by default. If no element defines the property, autocapitalization will be enabled.

The following example of configureAsFrameWithBreakableBlock disables auto capitalization in the docbook <programlisting> element:

JavaScript

configureAsFrameWithBreakableBlock(sxModule,'self::programlisting', 'programlisting', {
	contextualOperations: [{ name: 'programlisting-unwrap' }],
	isMonospaced: true,
	withNewlineBreakToken: true,
	allowAutocapitalization: false
});

Special characters

We've implemented lazy loading support for character sets in the fontoxml-special-characters add-on. If you are using custom character sets, other then the default one, change your code to use specialCharactersManager.addCharacterSetPath instead of .addCharacterSet, and move the character set JSON file to the asset folder of the package which configures the custom character set. See the add-on page fontoxml-special-characters for an example.

Bugfix in XHTML tables

We've fixed a bug in our XHTML tables implementation which caused tables to be marked as invalid in certain cases of nesting tables. If you have your own fork of fontoxml-table-flow-xhtml than please rebase to incorporate this fix.

Troubleshooting

The letter casing of some files in the platform folder were updated in this release, which can cause issues if you keep these files under a case-insensitive version control system. For Git (with ignoreCase enabled), a relatively safe way to fix this is to first delete the existing platform folder, stage those changes (git add ./platform), upgrade the editor using fdt editor upgrade --version 7.10.0, and then add all changes again and push them to your remote repository.