Rules generators

Below is the list of individual RulesGenerators. Some of them are used for convenience (rules that are expected by the average user, such as suspending formatting where code is expected) some are used for compliance (to ensure the output remains valid HTML5) and some are used for both.

Most rules generators are enabled by default, some must be enabled manually.

See Tag rules for the rules definitions.

AutoCloseIfVoid

Purpose: convenience. Default: enabled.

Generates an autoClose rule for tags that are rendered as void elements. For example, a BBCode that renders as an img element can be used as [img=foo.png].

AutoReopenFormattingElements

Purpose: convenience. Default: enabled.

Generates an autoReopen rule for tags that are renderered as formatting elements. Emulates HTML5's behaviour regarding misnested formatting elements.

BlockElementsCloseFormattingElements

Purpose: compliance. Default: disabled.

Generates a closeParent rule for tags that are renderered as "block" elements, targeting formatting elements. For example, div inside of b.

BlockElementsFosterFormattingElements

Purpose: convenience/compliance. Default: enabled.

Generates a fosterParent rule for tags that are renderered as "block" elements, targeting formatting elements. For example, div inside of b. Emulates HTML5's behaviour regarding misnested elements.

DisableAutoLineBreaksIfNewLinesArePreserved

Purpose: convenience. Default: enabled.

Generates a disableAutoLineBreaks rule for tags that render their content in an element that defaults to preserving new lines such as pre, or in an element that has a style attribute that preserves new lines such as <div style="white-space: pre">.

EnforceContentModels

Purpose: compliance. Default: enabled.

Generates denyChild, denyDescendant, disableAutoLineBreaks, enableAutoLineBreaks and suspendAutoLineBreaks rules to disallow tags in contexts where their HTML representation is not allowed.

See HTML5 Content Models.

EnforceOptionalEndTags

Purpose: compliance. Default: enabled.

Generates closeParent rules to automatically close tags in contexts where their end tag is optional (such as with consecutive li elements) and would otherwise be automatically created by the browser's HTML5 parser.

See HTML5 Optional Tags.

IgnoreTagsInCode

Purpose: convenience. Default: enabled.

Generates an ignoreTags rule for tags that render their content in a code element.

IgnoreTextIfDisallowed

Purpose: compliance. Default: enabled.

Generates an ignoreText rule for tags that disallow text content as per HTML5 content models. For example, between a ul element its li child.

IgnoreWhitespaceAroundBlockElements

Purpose: convenience. Default: enabled.

Generates an ignoreSurroundingWhitespace rule for tags that render their content in a "block" element such as div or blockquote. The concept of a "block" element does not exist in HTML5, the term is used loosely to designate elements that do not use the HTML5 phrasing content model. This rule lets the user insert an empty line to separate block elements (such as citations or list items) without adding unwanted brs to the output.

ManageParagraphs

Purpose: convenience/compliance. Default: disabled.

Generates createParagraphs rules for tags that render their content in a "block" element and breakParagraph for elements whose template automatically closes current paragraph as per HTML5's optional tags rules.

TrimFirstLineInCodeBlocks

Purpose: convenience. Default: enabled.

Generates a trimFirstLine rule for tags that render their content in a <pre><code> block.