Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra new line on footnote #721

Closed
5 of 11 tasks
Aqua-Dream opened this issue Mar 22, 2019 · 10 comments · Fixed by #752
Closed
5 of 11 tasks

Extra new line on footnote #721

Aqua-Dream opened this issue Mar 22, 2019 · 10 comments · Fixed by #752

Comments

@Aqua-Dream
Copy link

I agree and want to create new issue


Expected behavior

I'm using hexo-renderer-markdown-it-plus to support footnote. My source file is

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

Footnote test[^1].

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

So I expect the footnote should be

1. https://tieba.baidu.com/p/3551069391

Actual behavior

However, it is actually

1.
https://tieba.baidu.com/p/3551069391

As the following picture shows. Or you can also go to "https://aqua.hk.cn/Algorithm/plixxc/" to see the generated html. I find the problem is that the style of tag <p> is actually display: block;. After changing it to display: contents, there is no problem.

image

Steps to reproduce the behavior

Package dependencies Information

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"
  }

Hexo Information

Hexo version

hexo-cli: 1.1.0
os: Windows_NT 10.0.17134 win32 x64
http_parser: 2.8.0
node: 10.15.1
v8: 6.8.275.32-node.12
uv: 1.23.2
zlib: 1.2.11
ares: 1.15.0
modules: 64
nghttp2: 1.34.0
napi: 3
openssl: 1.1.0j
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e

NexT Information

NexT Version:

  • Latest Master branch
  • Latest Release version
  • Old version

NexT Scheme:

  • All schemes
  • Muse
  • Mist
  • Pisces
  • Gemini
@Aqua-Dream Aqua-Dream added the Bug label Mar 22, 2019
@stevenjoezhang
Copy link
Contributor

Add this to custom.styl:

ol.footnotes-list li p {
    display: contents;
}

@Aqua-Dream
Copy link
Author

Thanks!

@Aqua-Dream
Copy link
Author

@stevenjoezhang The problem is caused by this pull (#669) by setting the global style of li as "list-style-position: inside". Besides, this setting makes all the indents of li look too long. Please have a check!

@Aqua-Dream Aqua-Dream reopened this Mar 24, 2019
@stevenjoezhang
Copy link
Contributor

@Aqua-Dream I know, and I have checked... Do you have any good idea to solve this: https://stackoverflow.com/questions/21769248/list-with-nested-overflow-x-hidden-hides-list-counter-point-why-is-this-a-b , without setting list-style-position: inside?

@Aqua-Dream
Copy link
Author

My Chrome works well in this case:
image

@stevenjoezhang
Copy link
Contributor

In some cases there will be problems, such as the mathjax formula inside <li> element...

@Aqua-Dream
Copy link
Author

Aqua-Dream commented Mar 24, 2019

BTW, the math.styl file in my local demo has been commented.


Is it the default behavior of Mathjax or else...? It seems that my demo (katex) also works well:

---
title: test
date: 2019-03-24 11:09:59
tags:
mathjax: true
---
 - blablablablablablablablablabla 
 - blablablablablablablabla $f_{k+1}=x+(k+1)=(x+k)+1=S(x+k)=Comp_1^1[S,f_k]\in{\mathcal{BF}}=f_{k+1}=x+(k+1)=(x+k)+1=S(x+k)=Comp_1^1[S,f_k]\in{\mathcal{BF}}$

image

@stevenjoezhang
Copy link
Contributor

Seems only mathjax will broke the list style:
屏幕快照 2019-03-24 上午11 26 36
屏幕快照 2019-03-24 上午11 26 43

Need to modify source/css/_common/components/third-party/third-party.styl

@Aqua-Dream
Copy link
Author

Since each li tag corresponds to a ul or ol tag, my suggestion is to set overflow on ul and ol instead of li. BTW, in the block math mode of Katex, the equation can also overflow if it is too long. Maybe you need to consider how to add has-jax in Katex.

Personally, I will vote for keeping the default behavior (without setting overflow or anything) to avoid bugs, considering that the user themselves should avoid writing equations that are too long, even in Latex.

@stevenjoezhang
Copy link
Contributor

stevenjoezhang commented Mar 29, 2019

@Aqua-Dream Thanks. We changed the style back in #752. These warnings will be added to the docs:

  • avoid writing equations that are too long
  • avoid writing equations in the list

NO LONGER NEEDED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants