-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces Parser::setRawBlocks() and Parser::isRawBlocksEnabled(), that control raw block mode. When enabled, blocks that start with HTML tags are left as-is.
- Loading branch information
Showing
3 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Paragraphs wrapped in HTML are skipped when raw blocks are enabled: | ||
setup: | ||
- setRawBlocks: true | ||
input: | | ||
<p>Paragraph *with* _some_ Textile-like syntax.</p> | ||
<div> | ||
<p>Multiple -- *multiple* -- lines.</p> | ||
<p>...are supported by @Parser@</p> | ||
</div> | ||
But _normal_ paragraphs are still Textiled | ||
*normally*. | ||
<p>Escaped *tags* are not matched.<p> | ||
<p>Paragraphs starting with a space *are* parsed...</p> | ||
...and non-wrapped paragraphs work the *same* too. | ||
bc.. Extended blocks... | ||
<div>...and *code* are kept intact.</div> | ||
expect: | | ||
<p>Paragraph *with* _some_ Textile-like syntax.</p> | ||
<div> | ||
<p>Multiple -- *multiple* -- lines.</p> | ||
<p>...are supported by @Parser@</p> | ||
</div> | ||
<p>But <em>normal</em> paragraphs are still Textiled<br /> | ||
<strong>normally</strong>.</p> | ||
<p><p>Escaped <strong>tags</strong> are not matched.<p></p> | ||
<p>Paragraphs starting with a space <strong>are</strong> parsed…</p> | ||
…and non-wrapped paragraphs work the <strong>same</strong> too. | ||
<pre><code>Extended blocks... | ||
<div>...and *code* are kept intact.</div></code></pre> | ||
Raw blocks are still escaped in restricted mode, but Textile is not parsed: | ||
setup: | ||
- setRawBlocks: true | ||
- setRestricted: true | ||
input: | | ||
<p>Paragraph *with* _some_ Textile-like syntax<br /> | ||
is kept as is, but "escaped".</p> | ||
<p>Escaped *tags* are not matched.<p> | ||
<div>Wrapped *inlines* are parsed...</div> | ||
...and inline *too*. | ||
expect: | | ||
<p>Paragraph *with* _some_ Textile-like syntax<br /> | ||
is kept as is, but "escaped".</p> | ||
<p>&lt;p&gt;Escaped <strong>tags</strong> are not matched.&lt;p&gt;</p> | ||
<div>Wrapped <strong>inlines</strong> are parsed…</div> | ||
…and inline <strong>too</strong>. |