trailing spaces not allowed in code block
See original GitHub issueI’m encountering this error. I saw issue #190 and that a change was made for that, so I wasn’t expecting to get this error—not sure if my case is the same or different.
Inside my .md file, I have a Python code fragment within a code block:
if kind == "rect":
l, w = spec # assign tuple elements
draw_rect(l, w)
elif kind == "circle":
draw_circle(spec)
The “blank” line is included for clarity and has four spaces, which are needed to preserve the integrity of the if
…else
construct as a unit. I don’t need the spaces for the page to look right, but if someone copy/pasted the fragment, they’d end up with a syntax error. So, I’ve kept four spaces in the line. But that’s giving me an error.
Is this a different issue than #190? Am I missing something?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Leading and trailing white spaces in code blocks - Spec
I would like to ask about the title int the specs. Is it intended that the leading and trailing white spaces are trimmed...
Read more >no-trailing-spaces - ESLint - Pluggable JavaScript Linter
Rule Details This rule disallows trailing whitespace (spaces, tabs, and other Unicode whitespace characters) at the end of lines.
Read more >Always Getting an Error of "Trailing Spaces not Allowed" in ...
In vscode go to settings ( ctrl+, ) · In settings search bar type "trim trailing whitespace" · Underneath check "trim trailing whitespace"...
Read more >Markdown code snippets don't allow trailing spaces
Is there some reason you can't just use the Unicode character U+00A0 ( NO-BREAK SPACE ) for that trailing space? It should work...
Read more >Trailing Spaces - Visual Studio Marketplace
VS Code provides a way to automate deletion of trailing spaces by using the Trim Trailing Whitespace command. Depending on your settings, it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I’ll look at opting fenced code blocks into the exception.
Also would like to see this implemented. In my use case, I am generating markdown documentation for databases and so can’t guarantee (as is the case with my demo code) that the code within a database follows markdown best practices.
Giving a pass to the code blocks allows me to more tightly control my markdown, while not erroring out for the fenced code blocks that originate elsewhere.