@@ -70,7 +70,8 @@ import Text.Pandoc.Readers.HTML ( htmlTag, htmlEndTag, -- find code blocks
7070 rawHtmlBlock, rawHtmlInline )
7171import Text.Pandoc.Readers.Markdown (smartPunctuation)
7272import Text.ParserCombinators.Parsec
73−import Data.Char ( digitToInt )
73+import Data.Char ( digitToInt, isLetter )
74+import Control.Monad ( guard )
7475
7576-- | Parse a Textile text and return a Pandoc document.
7677readTextile :: ParserState -- ^ Parser state, including options for parser
@@ -312,7 +313,19 @@ inlineParsers = [ autoLink
312313
313314-- | Any string
314315str :: GenParser Char ParserState Inline
315−str = many1 (noneOf (specialChars ++ "\t\n ")) >>= return . Str
316+str = do
317+ xs <- many1 (noneOf (specialChars ++ "\t\n "))
318+ optional $ charsInBalanced '(' ')' -- drop acronym explanation
319+ -- e.g. PBS(Public Broadcasting Service)
320+ -- parse a following hyphen if followed by a letter
321+ -- (this prevents unwanted interpretation as starting a strikeout section)
322+ result <- option xs $ try $ do
323+ guard $ not . null $ xs
324+ char '-'
325+ next <- lookAhead letter
326+ guard $ isLetter (last xs) || isLetter next
327+ return $ xs ++ "-"
328+ return $ Str result
316329
317330-- | Textile allows HTML span infos, we discard them
318331htmlSpan :: GenParser Char ParserState Inline
@@ -384,4 +397,4 @@ simpleInline :: GenParser Char ParserState t -- ^ surrounding parser
384397 -> GenParser Char ParserState Inline -- ^ content parser (to be used repeatedly)
385398simpleInline border construct = surrounded border (inlineWithAttribute) >>=
386399 return . construct . normalizeSpaces
387− where inlineWithAttribute = (try $ optional attributes) >> inline
400+ where inlineWithAttribute = (try $ optional attributes) >> inline