Refactored hrule for performance in Markdown reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@935 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
8cf4971821
commit
74dc62e730
1 changed files with 5 additions and 5 deletions
|
@ -242,15 +242,15 @@ setextHeader = try $ do
|
||||||
-- hrule block
|
-- hrule block
|
||||||
--
|
--
|
||||||
|
|
||||||
hruleWith chr = try $ do
|
hrule = try $ do
|
||||||
count 3 (skipSpaces >> char chr)
|
skipSpaces
|
||||||
skipMany (skipSpaces >> char chr)
|
start <- oneOf hruleChars
|
||||||
|
count 2 (skipSpaces >> char start)
|
||||||
|
skipMany (skipSpaces >> char start)
|
||||||
newline
|
newline
|
||||||
optional blanklines
|
optional blanklines
|
||||||
return HorizontalRule
|
return HorizontalRule
|
||||||
|
|
||||||
hrule = choice (map hruleWith hruleChars) <?> "hrule"
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- code blocks
|
-- code blocks
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue