Commit Graph

60 Commits

Author SHA1 Message Date
Matt Bierner
8e88f8cf03 Update markdown grammar
Fixes #43150
2018-02-08 15:57:20 -08:00
Matt Bierner
9030f132e3 Use extracted markdown grammar
Fixes #43141
2018-02-08 12:59:25 -08:00
Mika Andrianarijaona
2472a47bc8 fix: add word boundray to check markdown italic (#41466)
* fix: add word boundray to check markdown italic

* fix: update markdown.tmLanguage.base
2018-01-24 08:40:25 -08:00
colinfang
d09e6ef353 Fix md block under a list is recognized as a paragraph (#39952) 2017-12-11 10:32:05 -08:00
Yuki Ueda
142d587bde Fix md quote syntax highlight(fix #38523) (#39487) 2017-12-04 10:59:37 -08:00
Matt Bierner
89f8a77cb8 Reapply #38328 with fix
Fixes #38049
2017-11-14 11:49:27 -08:00
Matt Bierner
fe48d23086 Revert "Fixes markdown link syntax highlighting bug (#38328)"
This reverts commit 5fd4061806.
2017-11-14 11:27:05 -08:00
Shivam Mittal
5fd4061806 Fixes markdown link syntax highlighting bug (#38328)
Issue: #38049

Signed-off-by: Shivam Mittal <shivammittal99@gmail.com>
2017-11-14 08:46:19 -08:00
Matt Bierner
f8bac907b7 Mark markdown yaml frontmatter as yaml embedded language
Fixes #30873
2017-10-16 14:45:06 -07:00
Matt Bierner
b6e7279be4 Fix language mode for script and style blocks in markdown
Fixes #34602
2017-09-18 17:41:48 -07:00
Matt Bierner
b45a168102 Mark markdown fenced code blocks with correct language mode
Fixes #34598
2017-09-18 15:52:41 -07:00
Matt Bierner
bf84cbcc37 Fix begin/end for markdown script/pre blocks
Fixes #33886
2017-09-06 14:11:01 -07:00
Matt Bierner
0ff02b2df7 Mark inline markdown code as strings for bracket matching and other editor features
Fixes #33513
2017-09-01 15:01:08 -07:00
Matt Bierner
59d5ce9f31 Make language identifier case insensitive for markdown code blocks
Fixes #32805
2017-08-18 14:42:16 -07:00
Matt Bierner
714a9c688f Fix markdown fenced code blocks for mixed fence types
Fixes #31206
2017-07-21 14:12:17 -07:00
Matt Bierner
32566fd1f1 Add scss and pug to markdown fenced codeblock syntax highlighting Fixes #28382 2017-06-09 14:54:50 -07:00
Bradley Meck
d6c61a0e12 Add .mjs to known JavaScript file extensions (#25747)
Also add .es6 in missing places
2017-05-04 16:21:08 -07:00
Matt Bierner
e105d5cc99 Fixes #20470 2017-04-21 15:59:52 -07:00
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