aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-09 08:52:09 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-09 08:52:09 -0800
commit88a40685b8d79dd97d16e2b3988e0e927ec24ec0 (patch)
tree550f01f0f9aeca1209156e46f44ab70c5bb00218
parent9ead748cc9cd79a8f490776d4d5dfe6cd0beb6f1 (diff)
downloadpandoc-88a40685b8d79dd97d16e2b3988e0e927ec24ec0.tar.gz
Textile reader: better treatment of acronyms.
We now parse PBS(Public Broadcasting System) as if it were "PBS (Public Broadcasting System)".
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs2
-rw-r--r--tests/textile-reader.native2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index d52b1fd58..d5add8f88 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -395,7 +395,7 @@ str = do
optional $ try $ do
lookAhead (char '(')
notFollowedBy' mark
- charsInBalanced '(' ')' -- drop acronym explanation
+ getInput >>= setInput . (' ':) -- add space before acronym explanation
-- parse a following hyphen if followed by a letter
-- (this prevents unwanted interpretation as starting a strikeout section)
result <- option xs $ try $ do
diff --git a/tests/textile-reader.native b/tests/textile-reader.native
index 680b43849..683ebd39b 100644
--- a/tests/textile-reader.native
+++ b/tests/textile-reader.native
@@ -127,7 +127,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
, [ Plain [Str "but",Space,Str "this",Space,HtmlInline "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,HtmlInline "</strong>"] ] ]
, Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"]
, Header 1 [Str "Acronyms",Space,Str "and",Space,Str "marks"]
-, Para [Str "PBS"]
+, Para [Str "PBS",Space,Str "(",Str "Public",Space,Str "Broadcasting",Space,Str "System",Str ")"]
, Para [Str "Hi",Str "\8482"]
, Para [Str "Hi",Space,Str "\8482"]
, Para [Str "\174",Space,Str "Hi",Str "\174"]