How do you control what pressing enter does in Create?

When the users caret is at the end of a title, whether that be a figure title or a section title, and the user presses enter, an "equation block" is inserted. equation block is a mathml related dita specialization and is not what we want to be inserted in this scenario.

  • When enter is pressed at the end of an element, the first that our editor will attempt it to split the current element, so create another element of the same type right after the current one.
    In the case of a title, the schema tells us that two titles are not allowed, so the editor will try to do something else. It will look at the list of possible next siblings and insert one of those elements. If this list of possible next siblings will contain a paragraph, it will choose that one. Otherwise it will just insert the first from the list (in your case the equation block).
    You can control what elements are to be preferred for inserting in such a situation by using the "auto-insert" role in the node configuration. In your case I actually expect a paragraph to be available in the list of next siblings for a figure title for example, so perhaps you also need to check if the 'topic/p' element actually has the "paragraph" role in the configuration.
  • An update on this one: this led to a support ticket, and we found out that the "equation-block" element actually is a specialization from the "topic/p" element. That causes it to inherit all configuration from "topic/p", including the "paragraph" role. This means that both elements are seen as valid candidates for being inserted in a situation like this.

    This can be prevented by using the following configuration in the nodeConfig for "equation-block":

    <x:role use="prohibited">paragraph</x:role>

    This will remove the paragraph role from this element, and the editor will then insert a normal paragraph after pressing enter in a title.