We also process the zero-spacing paragraph, <.P0>. This doesn't generate any output, but otherwise acts like a paragraph break in that it suppresses any paragraph breaks that immediately follow.
The special marker <./P0> cancels the effect of a <.P0>. This can be used if you want to ensure that a newline or paragraph break is displayed, even if a <.P0> was just displayed.
Our special processing ensures that paragraph tags interact with one another and with other display elements specially:
- A run of multiple consecutive paragraph tags is treated as a single paragraph tag. This property is particularly important because it allows code to write out a paragraph marker without having to worry about whether preceding code or following code add paragraph markers of their own; if redundant markers are found, we'll filter them out automatically.
- We can suppress paragraph markers following other specific sequences. For example, if the paragraph break is rendered as a blank line, we might want to suppress an extra blank line for a paragraph break after an explicit blank line.
- We can suppress other specific sequences following a paragraph marker. For example, if the paragraph break is rendered as a newline plus a tab, we could suppress whitespace following the paragraph break.
The paragraph manager should always be instantiated with transient instances, because this object's state is effectively part of the interpreter user interface, which doesn't participate in save and restore.
ParagraphManager : OutputFilter