WikiText parser mode transitions
This is a rough diagram whose lines mostly correspond to the parser mode transitions described below:
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
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.
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.