Is there a way to prevent the insertion of HTML <p> tags, if possible at selected places on page?
Prevent the automatic insertion of a <p> tag by the markup engine, at selected places in a page.
Add to config.php:
Markup('nop', 'directives', '/^\(:nop:\)/m', '<:block>');
This enables a directive
(:nop:) at the beginning of a line, which causes the following text on that line, to not be wrapped in
If you're writing a custom markup and do not want the output to be wrapped in <p> tags, you can simply include '<:block>' before it.
(:nop:) at the beginning of a line that you don't want wrapped in <p> tags. A previously open paragraph will be closed.
If the current line doesn't end with a backslash, and the following line doesn't start with
(:nop:) the latter will be wrapped in <p> tags.
The HTML <p> paragraphs below have a red dotted border:
This is a paragraph (:nop:) This is not Another paragraph (:nop:) Outside of paragraph \\ New line, outside or paragraph (:nop:) Not a paragraph A paragraph
This is a paragraphThis is not
Another paragraphOutside of paragraph
New line, outside or paragraph Not a paragraph
Change log / Release notes
- 20220423 Initial release, ready to be tested.
Written and maintained by Petko.