Require blankspace (but not multiple lines) between URL and
title in links and reference keys. (Markdown reader.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@599 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
f2c1777598
commit
61024d93ed
1 changed files with 6 additions and 5 deletions
|
@ -187,7 +187,7 @@ referenceKey = try $ do
|
|||
char labelSep
|
||||
skipSpaces
|
||||
option ' ' (char autoLinkStart)
|
||||
src <- many (noneOf (titleOpeners ++ [autoLinkEnd] ++ endLineChars))
|
||||
src <- many (noneOf [autoLinkEnd, '\n', '\t', ' '])
|
||||
option ' ' (char autoLinkEnd)
|
||||
tit <- option "" title
|
||||
blanklines
|
||||
|
@ -929,7 +929,7 @@ reference = try $ do
|
|||
source = try $ do
|
||||
char srcStart
|
||||
option ' ' (char autoLinkStart)
|
||||
src <- many (noneOf ([srcEnd, autoLinkEnd] ++ titleOpeners))
|
||||
src <- many (noneOf [srcEnd, autoLinkEnd, ' ', '\t', '\n'])
|
||||
option ' ' (char autoLinkEnd)
|
||||
tit <- option "" title
|
||||
skipSpaces
|
||||
|
@ -937,9 +937,10 @@ source = try $ do
|
|||
return (removeTrailingSpace src, tit)
|
||||
|
||||
titleWith startChar endChar = try (do
|
||||
skipSpaces
|
||||
option ' ' newline -- a title can be on the next line from the source
|
||||
skipSpaces
|
||||
leadingSpace <- many1 (oneOf " \t\n")
|
||||
if length (filter (=='\n') leadingSpace) > 1
|
||||
then fail "title must be separated by space and on same or next line"
|
||||
else return ()
|
||||
char startChar
|
||||
tit <- manyTill anyChar (try (do
|
||||
char endChar
|
||||
|
|
Loading…
Add table
Reference in a new issue