Type: Object

Configuration for Content Quality to be used in the content-quality-configuration configuration variable. Typically you only need to set the chunkIsContentQuery to ignore some of the elements which do not contain contents. And/or set the baseIETFLanguageQuery and nodeIETFLanguageQuery if you don't use the xml:lang attribute for languages or have you own default fallback language.



Type: XPathTest

An XPathTest which must return the base language string for a chunk in IETF BCP-47 format. This can be gotten either from an node, ancestor node or a default language fallback. Defaults to (ancestor-or-self::*[@xml:lang][1]/@xml:lang, "en-US")[1].


(: Fixed language :)


(: Custom language attribute using underscores :)
(ancestor-or-self::*[@language][1]/@language/replace(., "_", "-"), "en-US")[1]


(: Custom language attribute with mapping :)
(ancestor-or-self::*[@language][1]/editorName:getLang(@language), "en-US")[1]


// Register custom language mapping function
registerCustomXPathFunction('editorName:getLang', [ 'xs:string?' ], 'xs:string?', function (dynamicContext, language) {
    return mapLanguageToIETF(language) || null;


Type: Number

The timeout in milliseconds used for debouncing backend requests on content mutations. Defaults to 200.


Type: XPathTest

An XPathTest that determines if a node is a chunk. Defaults to fonto:block-layout(.) or fonto:is-removed(.) or fonto:closed(.).


Type: XPathTest

An XPathTest that determines if the chunk should be annotated. Defaults to fonto:block-layout(.) and not(fonto:closed(.)) and not(fonto:is-removed(.)).


(: Ignore some elements, for example in DITA do not process the data element and anything in a map :)
not(self::data) and not(/map) and fonto:block-layout(.) and not(fonto:closed(.)) and not(fonto:is-removed(.))


Type: Boolean

Indicates if Content Quality should be active on load. Defaults to false.


Type: XPathTest

An XPathTest which can return an IETF BCP-47 language code of a specific node, if any. This should NOT look at ancestors or default languages. Defaults to @Q{}lang.


(: Custom language attribute with mapping :) @language => editorName:getLang()


Type: Array<SemanticAttribute>

An array containing attributes which should trigger a recheck of a node when the attribute value changes. For example, language tag(s) or concept URIs. Defaults to [ { attributeName: 'lang', attributeNamespace: '' } ]


// If you have attributes which could impact the annotation results, you can specify them. For example in DITA
// when you use the `xref` element and have an annotator which checks validity (for example obsolete entities),
// you can specify the `href` attribute to be a semantic attribute.
    { attributeName: 'lang', attributeNamespace: '' },
    { attributeName: 'href', elementQuery: 'self::xref' }