diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-08-28 07:04:47 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-08-28 07:04:47 +0000 |
commit | 74dc62e7300b42f020005ec0f56a52e5ad41e1e0 (patch) | |
tree | 76f6de0a7018cb7aee8f77e40987b97a60cbf562 | |
parent | 8cf497182139774464350c7b97a42ce2a198e7aa (diff) | |
download | pandoc-74dc62e7300b42f020005ec0f56a52e5ad41e1e0.tar.gz |
Refactored hrule for performance in Markdown reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@935 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 0c635abee..d8c6edf22 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -242,15 +242,15 @@ setextHeader = try $ do -- hrule block -- -hruleWith chr = try $ do - count 3 (skipSpaces >> char chr) - skipMany (skipSpaces >> char chr) +hrule = try $ do + skipSpaces + start <- oneOf hruleChars + count 2 (skipSpaces >> char start) + skipMany (skipSpaces >> char start) newline optional blanklines return HorizontalRule -hrule = choice (map hruleWith hruleChars) <?> "hrule" - -- -- code blocks -- |