From e4263d306e6988dd322c895242eb818d22b9e012 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 7 Jul 2014 15:47:51 -0600 Subject: Revamped raw HTML block parsing in markdown. - We no longer include trailing spaces and newlines in the raw blocks. - We look for closing tags for elements (but without backtracking). - Each block-level tag is its own RawBlock; we no longer try to consolidate them (though `--normalize` will do so). Closes #1330. --- tests/writer.native | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'tests/writer.native') diff --git a/tests/writer.native b/tests/writer.native index 678d7595f..b38020335 100644 --- a/tests/writer.native +++ b/tests/writer.native @@ -232,11 +232,17 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"] ,Div ("",[],[]) [Div ("",[],[]) [Div ("",[],[]) [Plain [Str "foo"]]],Div ("",[],[]) [Plain [Str "bar"]]] ,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"] -,RawBlock (Format "html") "\n\n" +,RawBlock (Format "html") "" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "" +,RawBlock (Format "html") "" +,RawBlock (Format "html") "\n" +,RawBlock (Format "html") "\n\n
" ,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]] -,RawBlock (Format "html") "" +,RawBlock (Format "html") "" ,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]] -,RawBlock (Format "html") "
\n\n\n" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "" ,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"] ,Div ("",[],[]) [Plain [Str "foo"]] ,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"] @@ -246,17 +252,26 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "Now,",Space,Str "nested:"] ,Div ("",[],[]) [Div ("",[],[]) [Div ("",[],[]) [Plain [Str "foo"]]]] ,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"] -,RawBlock (Format "html") "\n" +,RawBlock (Format "html") "" ,Para [Str "Multiline:"] -,RawBlock (Format "html") "\n\n\n" +,RawBlock (Format "html") "" +,RawBlock (Format "html") "" ,Para [Str "Code",Space,Str "block:"] ,CodeBlock ("",[],[]) "" ,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"] -,RawBlock (Format "html") " \n" +,RawBlock (Format "html") "" ,Para [Str "Code:"] ,CodeBlock ("",[],[]) "
" ,Para [Str "Hr\8217s:"] -,RawBlock (Format "html") "
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" +,RawBlock (Format "html") "
" ,HorizontalRule ,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"] ,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."] -- cgit v1.2.3