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: coloring wrong after fenced code block #8259

Closed
bpasero opened this issue Jun 28, 2016 · 2 comments
Closed

Markdown: coloring wrong after fenced code block #8259

bpasero opened this issue Jun 28, 2016 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug markdown Markdown support issues verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Jun 28, 2016

Refs: #7945

image

The markdown content is:

# amdefine

A module that can be used to implement AMD's define() in Node. This allows you
to code to the AMD API and have the module work in node programs without
requiring those other programs to use AMD.

## Usage

**1)** Update your package.json to indicate amdefine as a dependency:

```javascript
    "dependencies": {
        "amdefine": ">=0.1.0"
    }

Then run npm install to get amdefine into your project.

2) At the top of each module that uses define(), place this code:

if (typeof define !== 'function') { var define = require('amdefine')(module) }

Only use these snippets when loading amdefine. If you preserve the basic structure,
with the braces, it will be stripped out when using the RequireJS optimizer.

You can add spaces, line breaks and even require amdefine with a local path, but
keep the rest of the structure to get the stripping behavior.

As you may know, because if statements in JavaScript don't have their own scope, the var
declaration in the above snippet is made whether the if expression is truthy or not. If
RequireJS is loaded then the declaration is superfluous because define is already already
declared in the same scope in RequireJS. Fortunately JavaScript handles multiple var
declarations of the same variable in the same scope gracefully.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug markdown Markdown support issues labels Jun 28, 2016
@kieferrm
Copy link
Member

kieferrm commented Jul 1, 2016

I'm not yet sure what happens. But when I add a\n or ; in front of the last '}' the tokenization is correct.

It seems the minimal case causing the wrong tokenization is:

screen shot 2016-06-30 at 7 16 20 pm

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 11, 2016

Most cases should be fixed by #14626 . I've tested the cases in this issue, and they work fine:

screen shot 2016-11-10 at 4 01 13 pm

screen shot 2016-11-10 at 4 01 59 pm

@mjbvz mjbvz closed this as completed Nov 11, 2016
@bpasero bpasero added the verified Verification succeeded label Dec 8, 2016
@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
bug Issue identified by VS Code Team member as probable bug markdown Markdown support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants