From 686603204661b7bf781b0400d0516e49e431345c Mon Sep 17 00:00:00 2001 From: warbee0712 Date: Tue, 3 Dec 2019 19:34:16 -0800 Subject: [PATCH] Improve display of footnote backlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes three changes to backlinks: - Inserts a space before `` to make it look better - Uses hexadecimal references (`&#x…;`) instead of decimal references for clarity - Adds U+FE0E VARIATION SELECTOR 15 to the ↩ to suppress emojification on both iOS and Edge on Windows If variation selector 15 isn't appended to the ↩, then the return arrow will show up as an emoji on iOS and Edge for Windows. The Pandoc project has already run into this quirk as documented on https://github.com/jgm/pandoc/issues/5469 and they've pushed a change for their Markdown processor already. --- extension/_test/footnote.txt | 4 ++-- extension/footnote.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extension/_test/footnote.txt b/extension/_test/footnote.txt index 7113be5..4a04a74 100644 --- a/extension/_test/footnote.txt +++ b/extension/_test/footnote.txt @@ -12,7 +12,7 @@ That's some text with a footnote.[^1]
  1. And that's the footnote.

    -

    That's the second paragraph.

    +

    That's the second paragraph. ↩︎

@@ -26,7 +26,7 @@ That's some text with a footnote.[^1]
  1. -

    0 [^]:

    +

    0 [^]: ↩︎

diff --git a/extension/footnote.go b/extension/footnote.go index cdab700..2fbcbb5 100644 --- a/extension/footnote.go +++ b/extension/footnote.go @@ -237,10 +237,10 @@ func (r *FootnoteHTMLRenderer) renderFootnoteBackLink(w util.BufWriter, source [ if entering { n := node.(*ast.FootnoteBackLink) is := strconv.Itoa(n.Index) - _, _ = w.WriteString(``) - _, _ = w.WriteString("↩") + _, _ = w.WriteString("↩︎") _, _ = w.WriteString(``) } return gast.WalkContinue, nil