This is a rough diagram whose lines mostly correspond to the parser mode transitions described below:
Start mode
By default the parser starts in block mode. However, a tiddler can instead be transcluded with inline mode in which case block mode WikiText will not be recognised.
At the start of text only, the parser will also recognise any pragma mode WikiText.
Transitions from pragma mode
At the start of text, the parser will recognise any pragma. If none are found then it will move to inline or block mode depending on the transclusion mode. If any pragma are found then it will continue looking for pragma until it finds one or more blank lines not followed by the start of a new pragma.
Transitions from block mode
When the parser encounters most block mode start punctuation it transitions to inline mode. This means he text enclosed by most block mode constructs will be parsed using inline mode.
However, there are a few constructs whose enclosed text is parsed using block mode:
When the start punctuation for these are encountered, the enclosed text will continue to be parsed in block mode.
Horizontal rules are another special case. They do not enclose any text, so there is no opportunity for the parser to transition to inline mode.
Opening widget or HTML tags provide another way the parser can transition. When such a tag is not followed by a blank line, then the contents enclosed by the tag will be parsed in inline mode. See the HTML examples.
Transitions from inline mode
- The parser will move back to block mode after the end of a line which terminates block mode WikiText. In other words, when the block mode close punctuation is encountered.
- When the opening widget or HTML tag is followed by a blank line, then the contents enclosed by the tag will be parsed in block mode. See the HTML examples.
- Transcluded text and text pulled in via a macro call can transition the parser away from inline mode. See transclusion examples and macro examples for more details.