-
Notifications
You must be signed in to change notification settings - Fork 201
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
[bug] Codeblock inside list has wrong indentation #2209
Comments
Indeed, looks like I run the "remove indents from |
Why not use pandoc ;) and its AST which makes it Commonmark compliant in all means ? It would be soo nice if bikeshed would use pandoc because, it would be a major benefit IMO |
Because Bikeshed-flavored Markdown makes two important changes divergences from CommonMark - no indented code blocks, and good handling of HTML with indentation. (These two are intrinsically connected; you can't do the second without the first.) So no, I can't use any other Markdown parser. |
Ok jeah, thats true, I also dont understand why indented codeblocks can not be deprecated, its nonsense IMO… |
Bit I thought the comman mark spec allows HTML everywhere except when its parsed as indented codeblock? |
CommonMark does not handle HTML well, with proper indentation and such. It fundamentally can't, because indented code blocks exist. So you can mix a little HTML into your standard Markdown, but you can't write a proper hybrid HTML/Markdown document, which was explicitly one of my goals with Bikeshed. Thus, Bikeshed-flavored Markdown is slightly different. The problem here isn't related to any of this, tho. It is indeed just a bug on my part - I just run the indent-removing code before the markdown code blocks are turned into a form that I can recognize as needing their indents removed. |
Ah thanks for the explanations, interessting. |
All right, took a surprising amount of twiddling before I hit on a correct solution I was happy with. All fixed now, tho. |
Thanks for your effort!! |
There is a regression I think: - a:
\```cpp
#pragma once
namespace {
static const float c_threshold = 3.14156f;
void myPrivateFunction() {}
}
\``` Still has wrong indentation. Dont know why. |
Ah, it was because you have a blank line in it, which has a zero-space prefix. I've now fixed the code to skip blank lines when calculating the prefix to strip, and confirmed that it catches some additional cases in my test files. |
Convert the following
Results in
The text was updated successfully, but these errors were encountered: