-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Markdown previewing for code blocks breaks when 1st line is square bracket #1668
Comments
@lwsrbrts can you attach the markdown? |
Sorry, that would have been the intelligent thing to do in the first place. :) https://raw.githubusercontent.com/lwsrbrts/PoSHue/master/README.md |
Thanks! |
So I did some sleuthing to try and figure out what was going on. The results of my tests are here README.md is your original file cut down to the part that was breaking. README-mod.md removes a space your first powershell code block. Tildes represent one whitespace character (space). ~2. Run
~
```powershell
~[HueBridge]::FindHueBridge()
~```
~3. README-1.md adds the one that you added when you were testing. None of the 3 parse README.md correctly. Only marked parses README-mod.md correctly. All 3 parse README-1.md correctly. (When I mean parse correctly ¯_(ツ)_/¯ |
marked seems to be dead markedjs/marked#724 Maybe switch to a more well-maintained markdown library like https://markdown-it.github.io/ ? |
I've since updated the linked readme.md so it no longer suffers from the issue but the following link is to the point in the repo where I reported the bug. https://raw.githubusercontent.com/lwsrbrts/PoSHue/4718c4f933031d8c2c8bcdc2bf0561ebe01e067a/README.md |
Since this issue was originally opened to track the markdown preview problems and those seem resolved, I'm going to close this. I've gone through the example file and opened issues to track some of the editor colorization problems: #12946 - No/bad colorization of codeblock immediately after a paragraph. Please let me know if you are still seeing issues with the preview, and feel free to open additional bugs to track colorization problems in the markdown editor. Thanks. |
A picture speaks a thousand words. First screenshot, Markdown previewing is incorrect and ordered numbering is subsequently broken also as a result of the first line of the code starting with an open square bracket. When the open square bracket is replaced with another character (a number 1 in the second screenshot), the preview works fine.


The text was updated successfully, but these errors were encountered: