From 6c741ae251abd461bb7b5ce28e7df7a9306bd005 Mon Sep 17 00:00:00 2001 From: yuin Date: Sat, 26 Dec 2020 18:08:59 +0900 Subject: [PATCH] Fixes #176 --- extension/_test/footnote.txt | 2 +- extension/footnote.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extension/_test/footnote.txt b/extension/_test/footnote.txt index 9b06721..0270c62 100644 --- a/extension/_test/footnote.txt +++ b/extension/_test/footnote.txt @@ -56,7 +56,7 @@ test![^1] [^1]: footnote //- - - - - - - - -// -

test1

+

test!1


    diff --git a/extension/footnote.go b/extension/footnote.go index 0b1ac9f..62f5ee6 100644 --- a/extension/footnote.go +++ b/extension/footnote.go @@ -175,6 +175,9 @@ func (s *footnoteParser) Parse(parent gast.Node, block text.Reader, pc parser.Co pc.Set(footnoteLinkListKey, fnlist) } pc.Set(footnoteLinkListKey, append(fnlist, fnlink)) + if line[0] == '!' { + parent.AppendChild(parent, gast.NewTextSegment(text.NewSegment(segment.Start, segment.Start+1))) + } return fnlink }