116 Commits

Author SHA1 Message Date
Matt Bierner
e3b3959d8f Remove droid sans fallback from default markdown font fallback 2017-01-18 22:05:04 -08:00
Matt Bierner
b29ef9b4e8 Prototyping Markdown Preview Synchronization With Editors (#18762)
* Adds command to post a message to an html preview

**Bug**
There is currently no easy way to communicate with an html preview document after the preview has been created.

**Fix**
Adds a command called `vscode.htmlPreview.postMessage` to post a message to a visible html preview. This message will only be posted if the target preview is visible.

Inside the preview, the event is recieved using the standard dom event:

* Remove logging

* proto

Continue proto

* clean up rendering

* Gate prototype

* Fix gating

* Remove public command

* Change setting name

* Added current position indicator

* Reveal center
2017-01-18 17:58:45 -08:00
Matt Bierner
5dc2fb8c30 Maintain Markdown Preview Scroll Position on Window Resize (#18760)
* proto

Continue proto

* Basic implementation
2017-01-18 15:42:32 -08:00
Matt Bierner
9721d92af8 Fixed named headers for markdown preview (#18759) 2017-01-18 14:17:26 -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
Matt Bierner
c932846c67 Wrapping in Markdown Preview (#17361)
* Improve markdown Wrapping

Includes a few improvements to the markdown preview

* Use breakword by default to break up very long words
* When `editor.worWrap` is enabled, wrap code blocks inside of the html preview.
* Reverts 41467b74b7 . This change is adding an 20px margin to the left of any html content. I believe the html content itself should be responsible for adding this padding and should normally fill the entire screen.
* Better centers markdown preview content

* Move padding to default webview style

* Remove padding change for now
2017-01-12 16:29:27 -08:00
Matt Bierner
7baf789eef Generate Line Number in Markdown Output HTML
Adds basic line number data to the output html of the markdown renderer
2017-01-09 15:04:47 -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
Alex Dima
90d74c59aa Use hex colors in themes integration tests 2017-01-05 09:47:08 +01:00
Alex Dima
10f68352a0 Themes integration tests 2017-01-04 22:44:08 +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
Matt Bierner
31e1aebf30 Fix markdown colorization tests 2017-01-03 11:15:05 -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
Matt Bierner
4bd5fc1d5e Fixes #17537 - serif fonts in markdown preview on some systems 2016-12-19 14:49:54 -08: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
Matt Bierner
0fe7046f49 Enable Strict Null Checks and Use Lib References in Markdown Extension (#16346)
Makes a few changes to the markdown extension:

* Enables explicit null checks.
* Enables no implicit any checks.
* Switch to using TS 2.0 lib files.

This change required removing the mocha declaration from the shared `declare.d.ts`. Everything seems to compile fine without it.
2016-12-02 11:07:40 -08:00
Matt Bierner
0c6333e604 Add font settings for markdown preview (#16302)
Fixes #4641

Adds basic settings for controlling the markdown preview font. We already support this with custom css, but these settings are similar to what the editor and integrated terminal expose and allow for a few basic customizations. Custom style sheets will override these.
2016-12-01 12:55:00 -08:00
Matt Bierner
b88a89c996 Allow markdown preview to scroll past content (#15919)
* Allow markdown preview to scroll past content

Issue #15795

Allows the markdown preview to scroll past its contents, like we do with the editor.

Closes #15795

* Toggle preview scroll beyond using editor.scrollBeyondLastLine
2016-11-29 14:51:15 -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
6e758c483b Use enum for md previewFrontMatter setting closes #16185 (#16188) 2016-11-29 09:49:20 -08:00
Matt Bierner
9ee2ad1258 Extract markdown decs strings for #13102 (#16177) 2016-11-28 15:10:07 -08:00
Matt Bierner
7320059e5c Don't translate Markdown.category Closes #16087 (#16159) 2016-11-28 12:48:23 -08:00
Daniel Imms
cbc0c0e66c Make cmd+k clear terminal on Mac
Fixes #12585
2016-11-22 17:49:31 -08:00
Matt Bierner
1957e44186 Delete emacs tmp file :( 2016-11-14 10:36:09 -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
Johannes Rieken
cf5c011529 Fix our snippets to be text mate compatible 2016-11-11 17:13:36 +01:00
Joao Moreno
2bb3dd5d95 enable duplicate imports tslint rule 2016-11-11 17:02:08 +01: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
Daniel Imms
a28dc215af Remove rootDir from the markdown ext's tsconfig
This was causing the output's folder structure to be based on the root of the
vscode project. This bring it in line with the other bundled extensions.

Fixes #15184
2016-11-09 14:14:31 -08:00
Faustino Aguilar
644b6c6b56 Support HTML comments in Markdown (#14573)
Because Java comment syntax is not valid in Markdown.
2016-11-08 14:14:36 -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
Martin Aeschlimann
2db37ea17a Wrong highlighting for angle bracket syntax in embedded language. Fixes #14551 2016-10-27 12:04:54 +02:00
Martin Aeschlimann
7bdc667cd4 Change HTML grammar to be more precise (embedded modes). fixes #14295 2016-10-24 23:19:07 +02:00
Benjamin Pasero
4384310ab2 'Open Preview' button for markdown files is not available anymore (fixes #13476) 2016-10-24 08:32:25 +02:00
Johannes Rieken
093cd8b2a3 enable integration tests again, cleanup a little of the ///-reference mess, #14059 2016-10-20 12:04:01 +02:00
Johannes Rieken
69a30b6531 tsfmt - extensions/markdown 2016-10-08 09:33:01 +02: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
5c32264d0e Update markdown syntax highlighing test results 2016-09-26 10:50:58 -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