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.

Formatting in markdown cannot be ignored in all cases

See original GitHub issue

Prettier 1.19.1 Playground link

Input:

## Documentation Overview
{:.no_toc}

- TOC
{:toc}

Output:

## Documentation Overview

{:.no_toc}

- TOC
  {:toc}

Expected behavior:

Output:

## Documentation Overview
{:.no_toc}

- TOC
{:toc}

The formatter currently changes the behavior. The prettified version doesn’t render the same.

Ignoring ranges also does not work because of https://github.com/prettier/prettier/issues/5557

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
domoritzcommented, Nov 23, 2019

I see. I’ve been writing HTML and Markdown for years and didn’t realize the issue since markdown doesn’t have closing tags. I can’t think of a good way to phrase this for the docs but will send a PR if I come up with something.

1reaction
thorn0commented, Nov 23, 2019

That’s how markdown works. You tried to put the closing comment inside the list.

It’d be easy to understand if we draw an analogy with HTML:

<!--prettier-ignore-start-->
<ul>
  <li>
    TOC
    {:toc}
    <!--prettier-ignore-end-->
  </li>
</ul>

If you know how to describe this in the docs to avoid confusion in the future I’d be happy to review a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown syntax causing issues - Atlassian Community
1 answer · Use a backslash to escape the hash - markdown will ignore the next "formatting" character after the \ character. ·...
Read more >
How do I ensure that whitespace is preserved in Markdown?
To preserve spaces in a markdown document use a non-breaking space: "a space character that prevents consecutive whitespace characters from ...
Read more >
Handbook Markdown Guide - GitLab
Emphasis: bold and italic​​ To display bold or italic text, wrap it in 2 stars (for bold) or underscores (for italic). For both...
Read more >
Markdown Content Help File Format - GitHub Pages
The Markdown help format is used to produce content that can be viewed on ... HTML list items and table cells elements) may...
Read more >
Markdown for customers - Zendesk help
Formatting helps customers such as myself document reported issues. I'm trying to describe very arcane issues to GitHub Enterprise Support with ...
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