summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Altamirano <s@stvs.tv>2023-01-29 19:10:48 -0800
committerGitHub <noreply@github.com>2023-01-29 19:10:48 -0800
commit1193bb59641f0fa0ab033d0382916be4c83e07da (patch)
tree0ee529afb5f6f5323c76fab87a6d3d01379a06b7 /src
parent9dbb75dacb26e8482f62fcfaeb7a48ff7b1d7f0e (diff)
Add support for Textile footnote backlinks (#8585)
Backlinking from footnotes is already the behavior of `Note` values when writing HTML. This adds parsing support for the explicit backlinking syntax in Textile as described here: https://textile-lang.com/doc/footnotes Previously, these lines would be interpreted as a new paragraph beginning with "fn3^." in text.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index e55d8e1eb..0cfe49c4f 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -90,7 +90,10 @@ parseTextile = do
Pandoc nullMeta . B.toList <$> parseBlocks -- FIXME
noteMarker :: PandocMonad m => TextileParser m Text
-noteMarker = skipMany spaceChar >> string "fn" >> T.pack <$> manyTill digit (char '.')
+noteMarker = do
+ skipMany spaceChar
+ string "fn"
+ T.pack <$> manyTill digit (string "." <|> try (string "^."))
noteBlock :: PandocMonad m => TextileParser m Text
noteBlock = try $ do