Skip to content
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 Incorrect Colorization of Fenced Code Blocks Inside of Block Quotes #12822

Closed
mjbvz opened this issue Sep 27, 2016 · 6 comments
Closed
Assignees
Labels
markdown Markdown support issues

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 27, 2016

For a markdown file like this:

> ```js
> 
> ```

**Blue Bold** white

The colorization is incorrect. Depending on what language is targeted, the colorization can break out of the code block entirely:

screen shot 2016-09-27 at 1 54 36 pm
screen shot 2016-09-27 at 1 54 31 pm

Here's what things should look like:

screen shot 2016-09-27 at 1 54 47 pm

The problem is that that block quote opening > are included as part of the fenced code block content. This causes some language colorizers to freak-out and highlight the entire rest of the file.

@mjbvz mjbvz added the markdown Markdown support issues label Sep 27, 2016
@mjbvz mjbvz self-assigned this Sep 27, 2016
@ghost
Copy link

ghost commented Sep 28, 2016

I suppose that this issue is kind of related to #3746. I'm having the same problem right now with JS code blocks.

@mjbvz
Copy link
Collaborator Author

mjbvz commented Sep 28, 2016

@dcbrwn Yes, this is another manifestation of #3746 but triggered by different behavior

In markdown, the fenced code block tokenizers for various programming languages can currently escape outside of the fenced code block if there is a syntax error in the block. In this example, the > is included inside the code content of the fenced code block because of incorrect parsing of block quotes. The Javascript highlighter sees the > and breaks out of the block entirely, and then tries to highlight the rest of the file.

I'm planning to address the core problem of fenced code block breakout soon.

@ghost
Copy link

ghost commented Oct 10, 2016

@mjbvz, mine issue with JS, TS and alike is caused by template string quote introduced in es6 ("`"). Workaround for now is to stick code blocks to some text like this (added back-slashes to preserve "```"):

Some text example:
\```typescript
const a = `the ${template} string`;
\```

@mjbvz
Copy link
Collaborator Author

mjbvz commented Nov 17, 2016

Original issue fixed by #14626

screen shot 2016-11-17 at 3 51 33 pm

@dcbrwn I think the issue you identified has also been fixed:

screen shot 2016-11-17 at 3 52 55 pm

Please try out the latest insiders builds and let me know if this is not the case.

@mjbvz mjbvz closed this as completed Nov 17, 2016
@calebmer
Copy link

Thanks so much guys for all the great work you do 🎉

@ghost
Copy link

ghost commented Nov 29, 2016

Seem to work as expected 👍

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
markdown Markdown support issues
Projects
None yet
Development

No branches or pull requests

2 participants