From c9d1d97a28aed30ced534c486963e9fc62114396 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Thu, 6 Sep 2012 10:38:56 -0700
Subject: Fixed footnotes bug in textile.

This affected notes occuring before punctuation, e.g.
`foo[1].`.

Closes #518.
---
 src/Text/Pandoc/Readers/Textile.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index 89f281ae8..5cda061ef 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -412,7 +412,7 @@ note = try $ do
 
 -- | Special chars
 markupChars :: [Char]
-markupChars = "\\[]*#_@~-+^|%="
+markupChars = "\\*#_@~-+^|%=[]"
 
 -- | Break strings on following chars. Space tab and newline break for
 --  inlines breaking. Open paren breaks for mark. Quote, dash and dot
@@ -430,7 +430,8 @@ hyphenedWords :: Parser [Char] ParserState String
 hyphenedWords = try $ do
   hd <- noneOf wordBoundaries
   tl <- many ( (noneOf wordBoundaries) <|>
-               try (oneOf markupChars <* lookAhead (noneOf wordBoundaries) ) )
+               try (notFollowedBy' note *> oneOf markupChars
+                     <* lookAhead (noneOf wordBoundaries) ) )
   let wd = hd:tl
   option wd $ try $
     (\r -> concat [wd, "-", r]) <$> (char '-' *> hyphenedWords)
-- 
cgit v1.2.3