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

Fix Fenced Code Syntax Highlighting in Markdown Leaking #14626

Merged
merged 2 commits into from
Nov 10, 2016

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Oct 27, 2016

Bug

This builds on #14488 to fix a number of issues where syntax highlighting leaks outside of code blocks in markdown files. A simple repo currently is this markdown:

**a**

```js
(
```

**a**

Which is incorrectly colored as:

screen shot 2016-10-27 at 1 41 58 pm

Fix

Leverage the updated while rule logic from #14488 to break out of language syntax highlighting when the end of a code block is detected:

screen shot 2016-10-27 at 1 42 53 pm

Also includes work to fix fenced code blocks where the size of the trailing fence is larger than the size of the starting fence:

```js
1;
`````

And cases such as:

```js
1;
                 `````

Possibly fixed issues include #9457, #8903, #8259, #13149, and others

This is not something we'd want to take into the current months release. I'd like to get some usage in insiders builds and target next month's release.

@mention-bot
Copy link

@mjbvz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kieferrm, @rebornix and @eklavyamirani to be potential reviewers.

@mjbvz
Copy link
Collaborator Author

mjbvz commented Oct 28, 2016

We'll likely want to wait to take in microsoft/vscode-textmate#30 first before we merge this PR into VSCode itself. This change on its own without the vscode-textmate update breaks highlighting of fenced code blocks inside of block quotes:

> ```js
> 1;
> ``` 

@alexdima alexdima modified the milestone: November 2016 Oct 28, 2016
mjbvz added a commit to mjbvz/vscode that referenced this pull request Nov 8, 2016
This bumps the vscode-textmate version to pick up this work: microsoft/vscode-textmate#30

Taking in this change allows us to take in fixes such as microsoft#14626, and also addresses some exisitng edge cases
@mjbvz mjbvz merged commit 5931743 into microsoft:master Nov 10, 2016
@mjbvz mjbvz added this to the November 2016 milestone Nov 10, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants