Changes to Markdown reader for better conformity to the
Markdown test suite under --strict: + Removed check for a following setext header in endline. A full test is too inefficient (doubles benchmark time), and the substitute we had before is not 100% accurate. + Don't use Code elements for autolinks if --strict specified. git-svn-id: https://pandoc.googlecode.com/svn/trunk@876 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
57d52c39ec
commit
84aa875bdb
1 changed files with 12 additions and 6 deletions
|
@ -786,8 +786,6 @@ endline = try $ do
|
|||
then do
|
||||
notFollowedBy emailBlockQuoteStart
|
||||
notFollowedBy (char '#') -- atx header
|
||||
notFollowedBy (manyTill anyChar newline >> oneOf setextHChars)
|
||||
-- setext header
|
||||
else return ()
|
||||
-- parse potential list-starts differently if in a list:
|
||||
if stateParserContext st == ListItemState
|
||||
|
@ -854,9 +852,10 @@ autoLinkEmail = try $ do
|
|||
char '<'
|
||||
name <- many1Till (noneOf "/:<> \t\n") (char '@')
|
||||
domain <- sepBy1 (many1 (noneOf "/:.@<> \t\n")) (char '.')
|
||||
let src = name ++ "@" ++ (joinWithSep "." domain)
|
||||
char '>'
|
||||
return $ Link [Code src] (("mailto:" ++ src), "")
|
||||
let src = name ++ "@" ++ (joinWithSep "." domain)
|
||||
txt <- autoLinkText src
|
||||
return $ Link txt (("mailto:" ++ src), "")
|
||||
|
||||
-- a link <http://like.this.com>
|
||||
autoLinkRegular = try $ do
|
||||
|
@ -864,7 +863,14 @@ autoLinkRegular = try $ do
|
|||
prot <- oneOfStrings ["http:", "ftp:", "mailto:"]
|
||||
rest <- many1Till (noneOf " \t\n<>") (char '>')
|
||||
let src = prot ++ rest
|
||||
return $ Link [Code src] (src, "")
|
||||
txt <- autoLinkText src
|
||||
return $ Link txt (src, "")
|
||||
|
||||
autoLinkText src = do
|
||||
st <- getState
|
||||
return $ if stateStrict st
|
||||
then [Str src]
|
||||
else [Code src]
|
||||
|
||||
image = try $ do
|
||||
char '!'
|
||||
|
|
Loading…
Reference in a new issue