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.

Commented line inside fenced code block causing problems

See original GitHub issue

Description

I have a fenced code block that looks like this

// express-fs-router/index.js
switch (typeof handler) {
  case 'function': {
    // export default function(req, res) {}
  }
  case 'object': {
    if (Array.isArray(handler) && handler.length) {
      // export default [function(req, res, next) {}, function(req, res) {}]
    }
  }
}

which is ultimately rendered as

image

Later in the same file I have a very similar fenced code block that does not cause a similar issue

// express-fs-router/index.js
switch (typeof handler) {
  case 'function': {
    // export default function(req, res) {}
  }
  case 'object': {
    if (Array.isArray(handler) && handler.length) {
      // export default [function(req, res, next) {}, function(req, res) {}]
      // get HTTP method from handler function name
      if (!method) method = handler[handler.length - 1].name
      // set to router
      router[method](route, ...handler)
    }
  }
}

which renders as

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
josefaidtcommented, Sep 11, 2020

@ekhaled thanks for the link! Disabling hotReload in the svelte-loader options resolved the issue, interesting! @pngwn is this okay to close now that we have a resolution?

0reactions
pngwncommented, Sep 11, 2020

Sure thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown fails to render code blocks with blank lines when ...
GitLab flavored markdown wrongly terminate fenced code blocks when 1) block contains blank lines (which is frequent in code) AND 2) code ...
Read more >
Insist that code fenced blocks are properly closed - Spec
A fenced code block could not be stopped by a paragraph, so the ending fence would be necessary to distinguish the end of...
Read more >
How to add comments to fenced code block within doxygen ...
Try with \code \code{.cpp} class Cpp {}; \endcode.
Read more >
Escaping Markdown Code Snippets and Inline Code as ...
Another related issue is escaping of the back tick character ` in an inline code block. The problem here is that the `...
Read more >
Implement ```-style (fenced) Markdown code blocks
The problem will grow bigger when combining with a list and long lines of code. – aldok. Jan 23, 2018 at 2:28. Add...
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