-
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
List block cannot have a second line #244
Comments
I tried it in https://dmitri.shuralyov.com/projects/live-markdown/live-markdown.html and could not reproduce. It rendered the way you expected. What configuration of blackfriday are you using? It seems to be a configuration issue. Also, what version of blackfriday are you using? It probably makes a difference. |
shurcooL, thanks. Your live-preview website helped me track down the problem. I'm not sure if my expectation was wrong, but what led me to the error was that in Journey Blog Engine there is a live preview (while I'm editing posts) which uses javascript showdown and where only a single space padding is enough for nesting the paragraph. However, during runtime journey uses blackfriday, and the nested paragraphs were breaking the ordered list. If 4 spaces is the correct minimum padding then please close this issue. Thanks for the help. |
Markdown spec is explicit about the four spaces:
FWIW, we have a PR (#37) hanging there since 2013 that proposes one-space indent for lists. Needless to say, I'm reluctant to merging it and it should probably be closed already. |
I was not aware that there are multiple standards, but just for reference:
Maybe a flag for CommonMark compatibility would make sense? Just a suggestion. |
CommonMark is definitely in the plans, but it will take quite some time to put together. |
Unfortunately, this is a common pitfall. Some Markdown packages require 4 spaces, some allow less. Blackfriday currently requires 4 spaces, or a single tab. A single tab is my personal preferred style for indentation.
I think it is "correct" for the current scope and goals of Blackfriday today. This may change in the future, but that's my current best estimate. Of course, not having a single definitive spec that we agree on makes the definition of correctness a fuzzy topic. CommonMark is a spec, but I'm not sure we all agree on it. I don't like it because it's too complicated. I'm not opposed to it, but I won't be able to contribute a lot of feature development to make it a reality. |
I also have this issue. DescriptionBasically text for one list item element (for on bullet) can be indented with two spaces. Gogs however ignores that and shows too spaces even if these are e.g. in code blocks. Example file1. Okay.
So let's start. (2 spaces)
2. Example
So go on. (4 spaces)
3. Example
4. Hi, step 4 is this (remove X below; I just needed it for escaping, so the code is displayed correctly):
`X``sh
echo yes > ChrootEveryone
echo 25 > MaxClientsNumber
echo 5 > MaxClientsPerIP
`X``
Adjust everything like you want.
> Also quotes
You can also just don't do it. Rendered on GitHub
Live examplehttps://try.gogs.io/rugk/markdown-indentation-parse-test/src/master/test.md |
Closing this because it works by the spec. |
There is no official markdown spec. This is just how it is always done, so… |
I treat the original Markdown spec by John Gruber as official. When we support CommonMark (I already have some progress on it), we will have another, better-defined spec, but for now I find having an under-defined spec better than not having any at all. |
So what? If you support CommonMark the thing this issue is about is defined here. And if you follow the "original spec", you can find the same thing here. (at "hanging indents") or later:
So in both specs you link too this is supported and your library does not follow any of these specs. |
@rugk, which of the four examples that you presented here do you think we ought to support? I have closed this due to what turned out to be a solved issue of OP. If you think the OP issue is not addressed, please be more specific. If you think some other of your provided examples should be supported, let's figure out if they belong to the same issue and address accordingly. |
Uhh, just reread this old issue. I would be fine with a flexible approach just allowing 2, 3 or 4 spaces (or tabs) or so. That's what GitHub does, as I showed in the example above. Just be flexible. |
There is an issue with ordered lists in the Creating HA clusters with kubeadm setup tutorial. All list items are labeled 1. This is because the underlying markdown processor for Hugo, blackfriday, requires list items with multiple paragraphs to have four space indentation. See (russross/blackfriday#244) This commit adds an extra space before paragraphs in lists so they are correctly interpreted as multi-paragraph lists. However, this exposes a bug in blackfriday where lines beginning with `-` in codefenced code blocks inside lists are parsed as sub-lists. This means code fenced code blocks inside lists that contain yaml are malformed. (See russross/blackfriday#239) So this commit mitigates this bug in two situations. It uses a 4-space indented code block in one situation. In another situation where a list only contained one element, it is no longer a list.
There is an issue with ordered lists in the Creating HA clusters with kubeadm setup tutorial. All list items are labeled 1. This is because the underlying markdown processor for Hugo, blackfriday, requires list items with multiple paragraphs to have four space indentation. See (russross/blackfriday#244) This commit adds an extra space before paragraphs in lists so they are correctly interpreted as multi-paragraph lists. However, this exposes a bug in blackfriday where lines beginning with `-` in codefenced code blocks inside lists are parsed as sub-lists. This means code fenced code blocks inside lists that contain yaml are malformed. (See russross/blackfriday#239) So this commit mitigates this bug in two situations. It uses a 4-space indented code block in one situation. In another situation where a list only contained one element, it is no longer a list.
There is an issue with ordered lists in the Creating HA clusters with kubeadm setup tutorial. All list items are labeled 1. This is because the underlying markdown processor for Hugo, blackfriday, requires list items with multiple paragraphs to have four space indentation. See (russross/blackfriday#244) This commit adds an extra space before paragraphs in lists so they are correctly interpreted as multi-paragraph lists. However, this exposes a bug in blackfriday where lines beginning with `-` in codefenced code blocks inside lists are parsed as sub-lists. This means code fenced code blocks inside lists that contain yaml are malformed. (See russross/blackfriday#239) So this commit mitigates this bug in two situations. It uses a 4-space indented code block in one situation. In another situation where a list only contained one element, it is no longer a list.
Given the following block:
Blackfriday is rendering this:
While I guess it shound render this:
Makes sense?
The text was updated successfully, but these errors were encountered: