markdown-it / markdown-it-footnote

Footnotes plugin for markdown-it markdown parser
https://markdown-it.github.io/
MIT License
210 stars 59 forks source link

Extra new line on footnote #31

Closed Aqua-Dream closed 5 years ago

Aqua-Dream commented 5 years ago

Copied from: https://github.com/CHENXCHEN/hexo-renderer-markdown-it-plus/issues/23#issue-423354262

  "dependencies": {
    "hexo": "^3.8.0",
    "hexo-all-minifier": "^0.5.3",
    "hexo-baidu-url-submit": "0.0.6",
    "hexo-deployer-git": "^1.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-baidu-sitemap": "^0.1.6",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-searchdb": "^1.0.8",
    "hexo-generator-sitemap": "^1.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-markdown-it-plus": "^1.0.4",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3",
    "hexo-symbols-count-time": "^0.4.4"
  }

My source file:

---
title: test
date: 2019-03-21 00:31:06
tags:
---

Footnote test[^1].

[^1]: https://tieba.baidu.com/p/3551069391

Behavior: image

Where the extra new line is marked by a red arrow.

Aqua-Dream commented 5 years ago

I've checked the elements in Chrome. It seems that it works by removing the <p> tag.

<li id="fn2" class="footnote-item"><p>... <a href="#fnref2" class="footnote-backref">↩︎</a> <a href="#fnref2:1" class="footnote-backref">↩︎</a></p></li>

to

<li id="fn2" class="footnote-item">... <a href="#fnref2" class="footnote-backref">↩︎</a> <a href="#fnref2:1" class="footnote-backref">↩︎</a></li>

Or change the attribute of <p> from "display: block" to "display: contents"

puzrin commented 5 years ago

online demo works as expected.