diff --git a/block_test.go b/block_test.go index b8903df..ae75f2b 100644 --- a/block_test.go +++ b/block_test.go @@ -473,3 +473,79 @@ func TestOrderedList(t *testing.T) { } doTestsBlock(t, tests, 0) } + +func TestPreformattedHtml(t *testing.T) { + var tests = []string{ + "
\n", + "
\n", + + "
\n
\n", + "
\n
\n", + + "
\n
\nParagraph\n", + "

\n
\nParagraph

\n", + + "
\n
\n", + "
\n
\n", + + "
\nAnything here\n
\n", + "
\nAnything here\n
\n", + + "
\n Anything here\n
\n", + "
\n Anything here\n
\n", + + "
\nAnything here\n
\n", + "
\nAnything here\n
\n", + + "
\nThis is *not* &proceessed\n
\n", + "
\nThis is *not* &proceessed\n
\n", + + "\n Something\n\n", + "

\n Something\n

\n", + + "
\n Something here\n\n", + "

\n Something here\n

\n", + + "Paragraph\n
\nHere? >&<\n
\n", + "

Paragraph\n

\nHere? >&<\n

\n", + + "Paragraph\n\n
\nHow about here? >&<\n
\n", + "

Paragraph

\n\n
\nHow about here? >&<\n
\n", + + "Paragraph\n
\nHere? >&<\n
\nAnd here?\n", + "

Paragraph\n

\nHere? >&<\n
\nAnd here?

\n", + + "Paragraph\n\n
\nHow about here? >&<\n
\nAnd here?\n", + "

Paragraph

\n\n

\nHow about here? >&<\n
\nAnd here?

\n", + + "Paragraph\n
\nHere? >&<\n
\n\nAnd here?\n", + "

Paragraph\n

\nHere? >&<\n

\n\n

And here?

\n", + + "Paragraph\n\n
\nHow about here? >&<\n
\n\nAnd here?\n", + "

Paragraph

\n\n
\nHow about here? >&<\n
\n\n

And here?

\n", + } + doTestsBlock(t, tests, 0) +} + +func TestPreformattedHtmlLax(t *testing.T) { + var tests = []string{ + "Paragraph\n
\nHere? >&<\n
\n", + "

Paragraph

\n\n
\nHere? >&<\n
\n", + + "Paragraph\n\n
\nHow about here? >&<\n
\n", + "

Paragraph

\n\n
\nHow about here? >&<\n
\n", + + "Paragraph\n
\nHere? >&<\n
\nAnd here?\n", + "

Paragraph

\n\n
\nHere? >&<\n
\n\n

And here?

\n", + + "Paragraph\n\n
\nHow about here? >&<\n
\nAnd here?\n", + "

Paragraph

\n\n
\nHow about here? >&<\n
\n\n

And here?

\n", + + "Paragraph\n
\nHere? >&<\n
\n\nAnd here?\n", + "

Paragraph

\n\n
\nHere? >&<\n
\n\n

And here?

\n", + + "Paragraph\n\n
\nHow about here? >&<\n
\n\nAnd here?\n", + "

Paragraph

\n\n
\nHow about here? >&<\n
\n\n

And here?

\n", + } + doTestsBlock(t, tests, EXTENSION_LAX_HTML_BLOCKS) +}