yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

Keep footnote backlinks with text #196

Closed brief closed 3 years ago

brief commented 3 years ago

goldmark has https://github.com/yuin/goldmark/discussions in github. You should post only issues here. Feature requests and questions should be posted at discussions.


Please answer the following before submitting your issue:

  1. What version of goldmark are you using? 1.3.2
  2. What version of Go are you using? 1.16
  3. What operating system and processor architecture are you using? macOS Big Sur 11.3 Beta / x86_64
  4. What did you do?

Created a footnote, like so:

This is a footnote[^1]

[^1]: Roses are red, violets are blue
  1. What did you expect to see?

Expected the last word of the footnote and the backlink arrow to wrap together, as follows:

This is a footnote¹

---

1. Roses are red, violets are
blue ↩

PHP Markdown Extra inserts a non-breaking space before footnote backlinks instead of a normal space. I thought this was a recent change, but it has apparently done this since 2006.

  1. What did you see instead?

The backlink arrow can break to a new line of its own on narrow screens:

This is a footnote¹

---

1. Roses are red, violets are blue
↩
  1. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension? N/A, as this is for the footnote extension.
yuin commented 3 years ago

That makes sense.