4. addBlockInFlow

Parameter syntax:

[ '['inline_container_element_name']' S ]? block_element_name|block_element_template

Intelligently adds specified block element after the text node containing the caret or after the explicitly selected element.

block_element_name, block_element_template

Specifies the element to be inserted.


Specifies an element which can contain a mix of text and inline elements. XHTML example: p. DocBook example: simpara (but not para which can also contain blocks). This element is needed to teach to the command which are the inline elements of the document type.

When this optional parameter is missing, the list of inline elements is parsed from the value of system property "configuration_name inlineElementNames". This property may contain a list of fully qualified element names and/or "container(container_element_name)" shorthands. See TEI example below.

Initially, this command has been designed to deal with XHTML elements such as li, dd, th, td, div, which not only can contain blocks (p, ul, table, etc), but can also contain a mix of text and inline elements (b, i, em, a, etc). This kind of content model is called a “flow”.

Example 6.1. XHTML example
              +--- caret is here
  <li><b>First|</b> item.</li>
  <li><b>Second</b> item.</li>

Generic command "add after[implicitElement] {http://www.w3.org/1999/xhtml}pre" gives:

  <li><b>First</b> item.</li>
  <li><b>Second</b> item.</li>

Smarter command "addBlockInFlow [p] {http://www.w3.org/1999/xhtml}pre" gives:

  <li><b>First</b> item.
  <li><b>Second</b> item.</li>


addBlockInFlow [p] table
addBlockInFlow [p] #template({http://www.w3.org/1999/xhtml}table,head_row)
Example 6.2. TEI example
<property name="$c inlineElementNames">

addBlockInFlow2 {http://www.tei-c.org/ns/1.0}table


container({http://www.tei-c.org/ns/1.0}pc) means any child element of {http://www.tei-c.org/ns/1.0}pc.


Because property "$c inlineElementNames" is defined, parameter inline_container_element_name is not needed by addBlockInFlow.