aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-05-10 22:06:13 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-05-10 22:06:13 +0000
commit61024d93edbee51a1fad18a1685a0d6087cb95da (patch)
treea2ff67714070aa27d8a325a69d5391a063c3f134 /src/Text/Pandoc/Readers
parentf2c1777598235809b555c6731f6bff1a7b75121d (diff)
downloadpandoc-61024d93edbee51a1fad18a1685a0d6087cb95da.tar.gz
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
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 05a958090..767d07a34 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -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