+ Fixed bug introduced into referenceTitle by previous changes.
Now it works as before. + Improved Markdown.pl-compatibility in referenceLink: the two parts of a reference-style link may be separated by one space, but not more... [a] [link], [not] [a link]. git-svn-id: https://pandoc.googlecode.com/svn/trunk@955 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
845a658aff
commit
60f700997c
1 changed files with 6 additions and 5 deletions
|
@ -168,8 +168,8 @@ referenceKey = try $ do
|
|||
optional (char '<')
|
||||
src <- many (noneOf "> \n\t")
|
||||
optional (char '>')
|
||||
tit <- option "" referenceTitle
|
||||
blanklines
|
||||
tit <- option "" referenceTitle
|
||||
blanklines
|
||||
return $ KeyBlock label (removeTrailingSpace src, tit)
|
||||
|
||||
referenceTitle = try $ do
|
||||
|
@ -178,7 +178,8 @@ referenceTitle = try $ do
|
|||
skipSpaces
|
||||
tit <- (charsInBalanced '(' ')' >>= return . unwords . words)
|
||||
<|> do delim <- char '\'' <|> char '"'
|
||||
manyTill anyChar (try (char delim >> blankline))
|
||||
manyTill anyChar (try (char delim >> skipSpaces >>
|
||||
notFollowedBy (noneOf ")\n")))
|
||||
return $ decodeCharacterReferences tit
|
||||
|
||||
noteMarker = string "[^" >> manyTill (noneOf " \t\n") (char ']')
|
||||
|
@ -825,8 +826,8 @@ link = try $ do
|
|||
|
||||
-- a link like [this][ref] or [this][] or [this]
|
||||
referenceLink label = do
|
||||
ref <- option [] (try (skipSpaces >> optional newline >>
|
||||
skipSpaces >> reference))
|
||||
ref <- option [] (try (optional (char ' ') >>
|
||||
optional (newline >> skipSpaces) >> reference))
|
||||
let ref' = if null ref then label else ref
|
||||
state <- getState
|
||||
case lookupKeySrc (stateKeys state) ref' of
|
||||
|
|
Loading…
Reference in a new issue