git.iko.soy/typeable/pandoc
on master help sign in
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

commit61024d93edbee51a1fad18a1685a0d6087cb95da authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 10 May 2007, 22:06 (19 years ago) parentf2c1777
1 file changed+6−5
src/Text/Pandoc/Readers/Markdown.hs+6−5
src/Text/Pandoc/Readers/Markdown.hs+6−5
@@ -187,7 +187,7 @@ referenceKey = try $ do
187187 char labelSep
188188 skipSpaces
189189 option ' ' (char autoLinkStart)
190− src <- many (noneOf (titleOpeners ++ [autoLinkEnd] ++ endLineChars))
190+ src <- many (noneOf [autoLinkEnd, '\n', '\t', ' '])
191191 option ' ' (char autoLinkEnd)
192192 tit <- option "" title
193193 blanklines
@@ -929,7 +929,7 @@ reference = try $ do
929929source = try $ do
930930 char srcStart
931931 option ' ' (char autoLinkStart)
932− src <- many (noneOf ([srcEnd, autoLinkEnd] ++ titleOpeners))
932+ src <- many (noneOf [srcEnd, autoLinkEnd, ' ', '\t', '\n'])
933933 option ' ' (char autoLinkEnd)
934934 tit <- option "" title
935935 skipSpaces
@@ -937,9 +937,10 @@ source = try $ do
937937 return (removeTrailingSpace src, tit)
938938
939939titleWith startChar endChar = try (do
940− skipSpaces
941− option ' ' newline -- a title can be on the next line from the source
942− skipSpaces
940+ leadingSpace <- many1 (oneOf " \t\n")
941+ if length (filter (=='\n') leadingSpace) > 1
942+ then fail "title must be separated by space and on same or next line"
943+ else return ()
943944 char startChar
944945 tit <- manyTill anyChar (try (do
945946 char endChar