git.iko.soy/typeable/pandoc
on master help sign in
Textile reader: better treatment of acronyms.

We now parse PBS(Public Broadcasting System) as if it were "PBS (Public Broadcasting System)".

commit88a40685b8d79dd97d16e2b3988e0e927ec24ec0 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 9 Dec 2010, 08:52 (16 years ago) parent9ead748
2 files changed+2−2
src/Text/Pandoc/Readers/Textile.hs+1−1 tests/textile-reader.native+1−1
src/Text/Pandoc/Readers/Textile.hs+1−1
@@ -395,7 +395,7 @@ str = do
395395 optional $ try $ do
396396 lookAhead (char '(')
397397 notFollowedBy' mark
398− charsInBalanced '(' ')' -- drop acronym explanation
398+ getInput >>= setInput . (' ':) -- add space before acronym explanation
399399 -- parse a following hyphen if followed by a letter
400400 -- (this prevents unwanted interpretation as starting a strikeout section)
401401 result <- option xs $ try $ do
tests/textile-reader.native+1−1
@@ -127,7 +127,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
127127 , [ Plain [Str "but",Space,Str "this",Space,HtmlInline "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,HtmlInline "</strong>"] ] ]
128128, Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"]
129129, Header 1 [Str "Acronyms",Space,Str "and",Space,Str "marks"]
130−, Para [Str "PBS"]
130+, Para [Str "PBS",Space,Str "(",Str "Public",Space,Str "Broadcasting",Space,Str "System",Str ")"]
131131, Para [Str "Hi",Str "\8482"]
132132, Para [Str "Hi",Space,Str "\8482"]
133133, Para [Str "\174",Space,Str "Hi",Str "\174"]