-
Notifications
You must be signed in to change notification settings - Fork 602
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
Deep nested lists don't output correctly #329
Comments
I think it's a matter of configuration. By default, tabs are set to size of 4 spaces, not two. Try using tab characters, or 4 spaces, and it renders as you'd expect.
|
Hmm, you're right... but it's really odd that it renders "Nested" correctly (which is only indented by '..' rather than '....'). I'd argue it should at least be consistent in its behaviour (although changing it to strictly observe the tab width configuration would probably break a lot of things). I would have usually used tabs, and I only used spaces because some Markdown cheat sheet said that nested lists were indented with two spaces (probably because it's easier to do it a web-browser). These things all render correctly, and they're all inconsistent...
It seems that any indentation greater than the previous depths tab-stop width causes it to indent. So:
The GitHub markdown by comparison seems to have a tab-width of 2, but requires that nested bullets be a tab-width deeper than the preceding bullet level. |
@jdale88 https://daringfireball.net/projects/markdown/syntax#list Standard for lists...note the "List markers typically start at the left margin, but may be indented by up to three space" |
two spaces works in the commonmark spec: Also, markdown linter defaults to 2 spaces maybe blackfriday should switch to 2 spaces |
That workaround does not work and still produces wrongly nested lists. This is annoying as linters such as markdownlint will both complain in VSCode and block CI for our documentation generator, but it fails to render correctly within GitLab and Hugo. Here's a round-up using the exact same source for the record, using VSCode vs GitHub vs Mattermost vs GitLab vs Hugo: |
Signed-off-by: Joachim Nilsson <[email protected]>
Can this not be fixed with an option setting? It is really frustrating when having to migrate from one platform to another. |
I would also like to share my opinion that this is annoying/frustrating. I just started with Hugo and I use Visual Studio Code with markdownlint and had to create a special setting override to set the tabsize for markdownlint to 4 instead of the default of 2. .markdownlint.json{
"MD007": { "indent": 4 },
"MD013": false
} Having all the tabstops at 4 seems to be OK for nested lists so far. Using Hugo version 0.40.2 |
I'd also like to see support for 2 space indenting, or at least an option for it. I use Gitea, which uses Blackfriday for Markdown rendering, and when cloning projects from GitHub or importing Markdown from elsewhere, it's not unusual |
This is breaking our lists as well. Would it be hard to update Blackfriday to how everything else works? (2 spaces) |
This continues to be out of step with other markdown implementations and causes significant problems for Hugo when migrating from other implementations. |
Seriously, something should be done. |
@concatime This is an open source project, maintained by volunteers who put there free time into this. |
Firstly, I've never stated otherwise. |
I've run into the same issue. To resolve this issue, I've write a new markdown parser that get full compliance with CommonMark1. It seems that almost users here run into this issue via applications using blackfriday. Footnotes
|
@yuin, is there any way for you to speak to the Hugo dev's to see if they could offer your library as an option? |
@TotallyInformation I am not a Hugo user and do not know Huge well. So I am not suitable for making new issues on Hugo. Could not you make a new issue on gohugoio/hugo? Hugo has already been used by so many users, so it may be hard that Hugo changes default markdown parser. But using goldmark as an optional markdown parser may be possible. If you make a new issue on gohugoio/hugo, you should talk about CommonMark. |
Thanks. I will try to find some time. I've not been active there for a while since my setup pretty much just works with the exception of these niggles with the MD. I would suggest it as an option rather than straight replacement as it clearly isn't a 1-2-1 replacement. |
I've noticed this when using orgmode as well. Is there a maintainer that can point me in the right direction to fix? |
I'm having issues with this at work, my coworkers are using standard markdown syntax for nested lists that is then not rendered correctly. A switch to two spaces for indentation would be really helpful. |
goldmark is now hugos markdown parser: https://gohugo.io/news/0.62.0-relnotes/ |
Blackfriday expects 4 spaces instead of 2 to correctly render deeply nested lists. See russross/blackfriday#329.
Blackfriday expects 4 spaces instead of 2 to correctly render deeply nested lists. See russross/blackfriday#329.
@dmitshur you mentioned that 4 is the default, but is it possible to change the default? |
I've noticed this with both Hugo and Live Markdown, but deep nested lists don't produce the results I'd expect to see based on other Markdown parsers.
The following Markdown:
Is output as:
But I'd expect to see:
The text was updated successfully, but these errors were encountered: