mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-23 16:56:43 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -269,7 +269,7 @@ A note.[1] Another note[2].
|
||||
fn1. The note
|
||||
is here!
|
||||
|
||||
fn2. Other note.
|
||||
fn2^. Other note.
|
||||
|
||||
h1. Comment blocks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user