**Bug**
The markdown grammar for fenced code blocks is rather unmaintainable since it involves lots of copy and pasted code
**Fix**
Use a gulp task and a template to generate the fenced code block grammars include directly. This allows adding new language support much more easily.
Fixes#18197
**Bug**
Autolinks that start a line in markdown are currently parsed as as html content
**Fix**
Restrict the html element parser a little more so that we don't match tags html tags that look like `<scheme:...>`
Fixes#18069
**Bug**
Script and style blocks inside markdown cannot contain blank lines
**fix**
Add a specific rule for script, style, and pre blocks according to the common mark spec: http://spec.commonmark.org/0.27/#html-block
* Improve Markdown code block tokens
Code blocks without a language weren't tokenized.
Code blocks didn't have their ending ``` punctuation tokenized.
Code blocks used to only have one token. Now each block has the following tokens available for syntax highlighters:
- Starting and ending ``` punctuations
- Code block's language setting
- Code snippet
* Variable whitespace for MD code block ``` token
Allow for variable amount of whitespacing before ``` code blocks
* Reorder raw blocks
Raw blocks were preventing tokenizing as languaged blocks. Putting them on bottom resolves this.
* Fix MD block detection when following paragraph
Used to require a new line inbetween ``` code blocks and preceding paragraph text.
* Prevent broken language grammar leaks in MD fences
Prevents leaks in MD code fences while also capturing the closing fence punctuations.
* Update Markdown tokenizer test file
- previously PHP wasn't working at all because we don't appear to properly support grammar injections. This issue was addressed by pointing to a specific repository key (#languages)
- ensure "fuzzy" syntax highlighting for PHP/HTML code so that script start tags are not required
* Add language support for yaml front matter to markdown grammar
* Add option to strip yaml front matter from preview
* Use enum for setting instead of boolean
* Better names
* Fix merge error
Issue #12948
**Bug**
- Block quotes ar not colorized if they start with a space. Up to three spaces should be supported (4 spaces makes it a code block)
- The second line of blocks quotes should be able to have any number of leading spaces.
**Fix**
Add support for both of these cases
Closes#12948
**bug**
Indented lists in markdown stop highlighting after four indents, even if they are nested.
**Fix**
Allow lists to also match the start of the line instead of the anchor point in their while clause. This ensure that each list element can consume up to three spaces at each level.
* Add rule for html comment in blocks
* Match common mark spec for html comments
* Updating tests and fixing some token names
* Fix style and script blocks
* Fix test file results
* Fixed markdown tests for new html logic
* Highlight Markdown Image Starting ! Puctuator
Issue #12835
Adds highlighting for the `!` that defines a markdown image link. This is colored the same as the `[` after it.
Closes#12835
* Fixed highlight test
Issue #12344
**Bug**
Current colorization rules are too relaxed. Links inside lists of block quotes for example end up getting colored differently than normal links.
**Fix**
- Add a scope to the textmate markdown grammar so that we can identify the symbol that starts a list or quote.
- Remove text colorization rule for lists and quotes since this just duplicates the normal text color.
- Only apply special puctuator colorization to the start symbol for lists and quotes
Issue #8264
**Bug**
Indented paragraphs are not highlighted in markdown files. Up to three spaces are allowed before the first non space character.
**Fix**
Add rule to consume optional spaces before paragrpah start.
closes#8264
**Bug**
Issue #7725
Nested html is not colorized properly for markdown:
```md
<div class="custom-class" markdown="1">
<div>
nested div
</div>
</div>
```
**Fix**
According to the commonmark spec, general html blocks end with a blank line: http://spec.commonmark.org/0.25/#html-blocks
This change relaxes the while so that we only check for blanklines, instead of trying to match the start tag (which fails when nesting elements)