question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

trailing spaces not allowed in code block

See original GitHub issue

I’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 ifelse 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, May 24, 2020

Thanks, I’ll look at opting fenced code blocks into the exception.

0reactions
lowlydbacommented, Jun 26, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found