From fadc7b0d873cb021b69d06bd37313be84afeecca Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Jul 2012 21:04:02 -0700 Subject: Major rewrite of markdown reader. * Use Builder's Inlines/Blocks instead of lists. * Return values in the reader monad, which are then run (at the end of parsing) against the final parser state. This allows links, notes, and example numbers to be resolved without a second parser pass. * An effect of using Builder is that everything is normalized automatically. * New exports from Text.Pandoc.Parsing: widthsFromIndices, NoteTable', KeyTable', Key', toKey', withQuoteContext, singleQuoteStart, singleQuoteEnd, doubleQuoteStart, doubleQuoteEnd, ellipses, apostrophe, dash * Updated opendocument tests. * Don't derive Show for ParserState. * Benchmarks: markdown reader takes 82% of the time it took before. Markdown writer takes 92% of the time (here the speedup is probably due to the fact that everything is normalized by default). --- tests/writer.opendocument | 100 +++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 54 deletions(-) (limited to 'tests/writer.opendocument') diff --git a/tests/writer.opendocument b/tests/writer.opendocument index 587c16502..3ca4a3564 100644 --- a/tests/writer.opendocument +++ b/tests/writer.opendocument @@ -665,27 +665,27 @@ - - + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -693,17 +693,9 @@ - + - - - - - - - - @@ -1342,33 +1334,33 @@ Markup is strong and -em. +em. So is -this word. -This -is -strong -and -em. +this word. +This +is +strong +and +em. So is -this word. +this word. This is code: >, $, \, \$, <html>. -This -is -strikeout. +This +is +strikeout. Superscripts: -abcd -ahello -ahello there. +abcd +ahello +ahello there. Subscripts: -H2O, -H23O, -Hmany of themO. +H2O, +H23O, +Hmany of themO. These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d. @@ -1400,16 +1392,16 @@ five. 2 + 2 = 4 - x ∈ y + x ∈ y - α ∧ ω + α ∧ ω 223 - p-Tree + p-Tree Here’s some display math: @@ -1417,7 +1409,7 @@ five. Here’s one that has a line break in it: - α + ω × x2. + α + ω × x2. These shouldn’t be math: @@ -1428,7 +1420,7 @@ five. $22,000 is a - lot of money. So is $34,000. + lot of money. So is $34,000. (It worked if “lot” is emphasized.) @@ -1437,10 +1429,10 @@ five. Escaped $: $73 - this - should - be - emphasized + this + should + be + emphasized 23$. @@ -1589,10 +1581,10 @@ indented to show that they belong to the footnote (as with list items).{ <code> }If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. This -should not be a footnote +should not be a footnote reference, because it contains a space.[^my note] Here is an inline note.3This -is easier to type. Inline notes +is easier to type. Inline notes may contain links and ] verbatim characters, -- cgit v1.2.3