configureAsFrameWithBreakableBlock

How to get configureAsFrameWithBreakableBlock

import configureAsFrameWithBreakableBlock from 'fontoxml-families/src/configureAsFrameWithBreakableBlock.js'

Type: Function

Use this family for block level elements that apply a semantic connotation to their content, may directly contain text and/or inlines, and can contain break tokens or break elements to delimit blocks within that text.

As this family indicates a semantic structure, it is visualized through a border and optionally a background color to delimit the content to which the semantics apply.

Elements belonging to this family cannot be split in two by pressing Enter, and two adjacent elements will not be merged into one. Either would defeat the purpose of semantics.

Use this family for elements that may directly contain break tokens or break elements as well as text and/or inline elements, but also represent certain semantic units.

The following visualization options are visualized by the frameWithBreakableBlock family:

  • backgroundColor

  • showWhen

  • textAlign

Set withNewlineBreakToken to true to indicate a newline character should be used to break blocks. This will automatically set whitespace to 'preserve'. Alternatively, set breakElements to an array of the qualified names of elements that are used to define boundaries between blocks inside this element. Make sure to configure these elements themselves using configureAsBreakElement. Using break elements has no effect on whitespace handling.

The following widget areas are available:

  • blockHeaderLeft

  • blockHeaderRight

  • blockBefore

  • blockAfter

  • blockFooter

  • blockOutsideBefore

  • blockOutsideAfter

This family has a number of additional options which affect how it behaves:

  • defaultTextContainer

Autocapitalization

The CVK config variable allowAutocapitalization can be used to enable or disable the autocapitalization inside elements.

The valid values are:

  • true – The autocapitalization is applied in these elements and all children that are also true or undefined.

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

  • 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.

This is an example in configureAsFrameWithBreakableBlock of how disable the autocapitalization in code blocks:

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

Arguments

# Name Type Description
1. sxModule SxModule
2. selector XPathTest
3. markupLabel String
4. options CvkOptions
Was this page helpful?