Commit Graph

42 Commits

Author SHA1 Message Date
Matt Bierner
0656b2b090 Update markdown grammar to allow better injection into unknown fenced code blocks 2017-04-11 17:35:28 -07:00
Richard Min
9875ae1077 Support ... terminating Yaml FrontMatter (#23195)
* FrontMatter rendered properly on markdownEngine

* FrontMatter terminates for 3 - or .

* Regex applied on both files for markdown
2017-03-24 19:56:53 -07:00
Matt Bierner
1dd884a88a Use Gulp To Generate Markdown Langauge Includes (#22117)
**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.
2017-03-06 18:21:16 -08:00
Matt Bierner
3d349aa9dc Add f# language syntax highlighting to markdown files Fixes #9457 2017-03-06 16:54:11 -08:00
Matt Bierner
0c37c544d1 Fixes #21629 2017-03-06 16:18:48 -08:00
katainaka
96ba7c27aa Fixed colorization of nested list. (#19596)
Fixed colorization of nested list with unindented line.
2017-02-01 14:18:23 -08:00
Matt Bierner
4d9dc7479b Fixes #19612 script tag on same line breaks markdown colorization 2017-01-31 11:26:16 -08:00
Matt Bierner
2e0df7fc38 Fixes #19610 2017-01-31 11:09:41 -08:00
Morag S
22cc4a1ce7 Markdown fixes (#18704)
* Fix typos

* Add Go, Rust and Scala

* Adjust Go, Rust and Scala's logic as per #17591
2017-01-20 12:51:09 -08:00
Matt Bierner
3d71a3254b Simplify markdown paragraph logic (#18531)
* Simplify markdown paragraph logic

* Fix for alt headers
2017-01-13 23:24:32 -08:00
Matt Bierner
cf3d092b2e Fixes #11480 (#18532) 2017-01-13 15:52:41 -08:00
Matt Bierner
1bbe4342d7 Fixes #18530 2017-01-13 13:57:28 -08:00
Alex Dima
51b5727501 Merge remote-tracking branch 'origin/master' into alex/tokenization 2017-01-06 17:06:26 +01:00
Matt Bierner
83db3cad0c Fix Autolink Syntax Highlighting in Markdown (#18201)
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:...>`
2017-01-05 17:03:39 -08:00
Alex Dima
ebc43b3e8b Merge remote-tracking branch 'origin/master' into alex/tokenization 2017-01-05 12:31:43 +01:00
Matt Bierner
a2ae9109e5 Fix markdown syntax highlighting for script or style html elements with blank lines (#18116)
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
2017-01-04 11:44:07 -08:00
Josh Peng
b9a362a185 Improve Markdown code block tokens (#17591)
* 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
2017-01-03 10:03:16 -08:00
Alex Dima
8998f7a53d Adopt new vscode textmate 2017-01-03 15:36:08 +02:00
Sara Itani
fbbaa23180 Merge pull request #16502 from mousetraps/i3746
Fix markdown + PHP fenced code blocks
2016-12-05 15:28:20 -08:00
Sara Itani
3c21bf9cd2 Fix markdown + PHP fenced code blocks
- 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
2016-12-05 04:31:52 -08:00
Garrett Serack
d1e9f7339e allow text after the language id in a markdown codeblock (consistent with github, the md preview window and other gfm parsers) (#16239) 2016-11-29 14:49:41 -08:00
Matt Bierner
eb563582f4 Add yaml front matter support for Markdown (#15218)
* 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
2016-11-11 15:09:32 -08:00
Matt Bierner
5d8a9c6b42 Fix Markdown Colorization of Indented Block Quotes (#15220)
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
2016-11-10 16:42:32 -08:00
Matt Bierner
5931743a01 Fix Fenced Code Syntax Highlighting in Markdown Leaking (#14626)
* Use while in fenced code blocks to prevent breakout

* Fix a few edge cases for code blocks
2016-11-10 15:57:44 -08:00
Matt Bierner
79a695b91d Improve Markdown Syntax Highlighting of Nested Lists (#14634)
**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.
2016-11-08 14:04:19 -08:00
Matt Bierner
603e08d62d Improve Markdown Html Block Colorization (#12696)
* 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
2016-11-08 10:38:33 -08:00
Matt Bierner
3eacbae040 Highlight Markdown Image Starting ! Punctuator (#12841)
* 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
2016-11-07 16:03:49 -08:00
Kai Maetzel
37cffbd031 Merge pull request #11066 from eklavyamirani/master
Fixed: Markdown syntax highlighting to support alternative header styles
2016-09-26 17:44:21 -07:00
Matt Bierner
0b70faeec6 Fix colorization of markdown links and inlines inside of lists and quotes
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
2016-09-26 10:50:58 -07:00
Matt Bierner
93d16ef30a Fix colorization for markdown indented paragraphs
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
2016-09-26 10:49:47 -07:00
Matt Bierner
265c025bbf Use blankline to delimit html block in markdown colorization
**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)
2016-09-26 10:48:54 -07:00
Matt Bierner
102adb766e Also support any number of spaces after end of closing fenced code block 2016-09-26 10:47:31 -07:00
Matt Bierner
69f2e874fc Fix Markdown Colorization for Fenced Code Blocks When End Fence Is Prefixed by Spaces
Issue #8636

**Bug**
Fenced code block closing tags break colorization if they are prefixed with spaces. According to the commonmark spec, up to three spaces are allowed.

**Fix**
Update defintion of fenced code block closing tag to support spaces.

Closes #8636
2016-09-26 10:47:31 -07:00
Matt Bierner
90d58f4909 Fix colorization of html prefixed by spaces in markdown files
Issue #12289

**Bug**
Html tags prefixed by 1 to 4 spaces are not colorized properly

**Fix**
Consume optional leading whitespace when matching html tags instead of only starting from previous match location

closes #12289
2016-09-26 10:46:00 -07:00
Matt Bierner
5169a9806a Add Syntax Highlighting for C# Code in Markdown files
Adds c# to the list of language highlighted in markdown fenced code blocks. You must have a c# language extension install for this to work.

Closes #7003
2016-09-26 10:44:14 -07:00
Eklavya Mirani
2e886c0708 fixed broken markdown tests. 2016-08-28 23:20:58 +05:30
Eklavya Mirani
9aff1d0f74 Added the --- seperator to the paragraph rule
to allow heading-setext.2 rule to be recognized
2016-08-28 16:31:02 +05:30
Eklavya Mirani
45fbd00dd5 Moved TM Markdown seperator rule below the Paragraph
rule to fix the alt heading 2 syntax highlighting.
2016-08-27 13:55:51 +05:30
rebornix
c958b5cb37 Fix #6113 2016-06-20 17:42:20 +08:00
kieferrm
2ac170e64e fix hygiene issues 2016-06-14 15:01:58 +02:00
kieferrm
ed5eb10f9e paragraphs stop at list item boundaries 2016-06-14 15:01:58 +02:00
kieferrm
0b856de5a7 prepackage markdown extension 2016-06-14 15:01:58 +02:00