Commit Graph

200 Commits

Author SHA1 Message Date
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
0185e327ab Extract markdown preview strings to constant 2017-03-23 22:31:43 -07:00
Matt Bierner
7bc40aace8 Prototype allowing scripts to be contributed to markdown preview 2017-03-23 22:29:34 -07:00
Matt Bierner
105e5f2ea8 Allow data font sources in markdown preview 2017-03-23 20:06:10 -07:00
Matt Bierner
00187b0065 Add font-src csp rule for default markdown content to allow custom fonts 2017-03-22 12:59:04 -07:00
Matt Bierner
4f8e68b814 Second prototype of markdown extensions (#22836) 2017-03-20 11:16:18 -07:00
Matt Bierner
eb0a05f7b5 Fix return 2017-03-16 17:49:22 -07:00
Matt Bierner
09ec3557c8 Prototype Allowing Extensions to Extend the Builtin Markdown Extension (#22421)
* Prototype Allowing Extensions to Extend the Builtin Markdown Extension

**Problem**
There have been requests for adding new functionality to the markdown extension preview, such as supporting rendering of math or other syntax in the preview. The only current solution to this is create an extension that provides its own markdown preview. This results in inconsitent behavior with our markdown preview and is not a very scalable approach. We would like to find a way to allow users to add these extensions to our markdown preview without bundling the extensions in the preview itself.

**Fix**
Prototypes a new contribution point that extensions can use to extend the vscode markdown extension. Three types of extensions are possible: adding stypes to the preview, adding scripts to the preview, and extending the markdown it renderer.

My current approach defines the contributed markdown extensions in the package.json using a structure like this:

```
  "contributesTo": {
    "vscode.markdown": {
      "plugins": [
        "./out/math"
      ],
      "scripts": [],
      "styles": [
        "./media/math.css"
      ]
    }
  }
```

We could change the structure here. This design uses a pull model where markdown extensions are looked up by the vscode.markdown extension itself.

The other approach for extension registration would be to use a push model. This would have the vscode.markdown extension export an api that each markdown extension would invoke to register new scripts/styles/plugins. I may switch over to this model but was interested in seeing what a more declarative approach would look like. Let me know if you have any thoughts one way or the other.

The downside of allowing extensions like this is that they can completely change how the markdown preview looks and works. There is no well defined API for restricting what extensions can do like we have with VScode.

* Use extensionDependencies

* Remove example extension

* Added gating and activation event
2017-03-16 17:27:39 -07:00
Matt Bierner
31d0799fd8 Fix Markdown TOC Provider for Invalid References (#22553)
Fixes #22494

**Bug**
References without a definition can cause the markdown table of contents provider to break

**Fix**
Pass in an empty environment to markdown-it `parse` to prevent the null dereference on invalid links.
2017-03-13 10:49:59 -07:00
Matt Bierner
3b7329eab8 Fix markdown document link highlighter for empty links 2017-03-10 16:37:59 -08:00
Matt Bierner
62e989849b better support nested lists for markdown scroll sync 2017-03-07 17:07:22 -08:00
Matt Bierner
af7df75fab Add ending marker for markdown scrollsync 2017-03-07 16:40:21 -08:00
Matt Bierner
104445989a Allow inline styles in markdown preview 2017-03-07 15:15:59 -08: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
Matt Bierner
4ebfc2fc18 Add Enhanced Security Settings to Markdown Preview
Adds enhanced security settings for the markdown preview. The new flow disable all scripts within the preview itself. Users can enable scripts on a per workspace basis.

When a markdown document that uses scripts is loaded, a warning is shown inside the document itself. This warning triggers a new security selector quick pick which allows users to enable or disable enahanced security in the workspace.
2017-03-03 13:56:23 -08:00
Matt Bierner
a801f731ee Fixes #21591 2017-02-28 19:31:49 -08:00
Martin Aeschlimann
8293443262 [markdown] enable wordWrap & disable quickSuggestions 2017-02-24 11:02:45 +01:00
Kai Maetzel
919580fdd8 Upgrade telemetry package used by TS and markdown extensions. (#20971)
* upgrade telemetry used by TS ext

* upgrade telemetry used by markdown ext
2017-02-21 15:26:30 -08:00
Martin Aeschlimann
74a6d6d423 fix tests for #20610 2017-02-20 17:34:05 +01:00
Matt Bierner
7a82ac3ff9 Small markdown code cleanup 2017-02-15 14:49:41 -08:00
Matt Bierner
80a864ebc1 Fix markdown editor link possibly breaking 2017-02-14 17:12:37 -08:00
Matt Bierner
4f6efb0ef5 Use same slugify logic for editor links as well 2017-02-14 17:07:38 -08:00
Kazuyuki Sato
ac5beb61b2 markdown-it-named-header custom slugify for non-latin characters (#20628)
* markdown-it-named-header custom slugify for non-latin characters

* Delete comment
2017-02-14 16:50:20 -08:00
Matt Bierner
6b5c143705 Clarify markdown setting string. Fixes #20409 2017-02-13 14:17:27 -08:00
Matt Bierner
3da42e5659 Debounce markdown selection update events Fixes #19827 2017-02-09 17:55:59 -08:00
Matt Bierner
789fa53908 Fix markdown links no opening 2017-02-09 13:41:11 -08:00
Matt Bierner
4b007e50d2 Improve markdown preview handling of ill formatted html Fixes #20199 2017-02-08 13:28:48 -08:00
Matt Bierner
42335c57f5 Revert "Use types tsconfig option where possible"
This reverts commit 38fbba35ff.
2017-02-07 16:31:50 -08:00
Matt Bierner
38fbba35ff Use types tsconfig option where possible 2017-02-07 15:57:22 -08:00
Matt Bierner
1a024c1b19 Use reference @types/node in extensions 2017-02-07 15:38:04 -08:00
Matt Bierner
cc2c7c0a1a Improve Markdown Preview Code Block Coloring
Fixes #7776

**Bug**
Code blocks in the markdown preview are not very good looking

**Fix**
Use default text color for indented code blocks and add a background
2017-02-06 17:18:58 -08:00
Matt Bierner
f401c72a55 Enable Markdown Scroll Syncronization for Untitled Files (#20072)
Fixes #20070

**Bug**
Markdown scroll sync and other sync features do not work for untitled files. The root cause seems to be that the `main.js` markdown file is never loaded

**Fix**
Instead of a using a path without a scheme for `main.js`, use a `file://` path
2017-02-06 11:20:36 -08:00
Matt Bierner
4e91a74c6f Fix Markdown Scroll Sync For Windows Path Casing (#20064)
**Bug**
Scroll sync not working for some users on windows

**Fix**
Root cause seems to be that windows drive/path cases can sometimes differ between preview and editor document. Adds a equality check based on `fsPath` as well
2017-02-06 10:19:45 -08:00
Matt Bierner
4495f714a9 Fix Slow Markdown Front matter stripping regexp (#19894)
**Bug**
For long/not-terminated frontmatter in a markdown file, we can currently hang the process while trying match it using a regular expression

**Fix**
Use a more efficent regexp to do this.
2017-02-03 17:56:52 -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
4afd014791 Add no unused paramter option to markdown extension 2017-02-01 13:34:35 -08:00
Matt Bierner
7c633148b3 Remove unneeded d.ts files from extensions (#19653)
* Remove unneeded d.ts files from extensions

Moves most extensions to use the lib files for the standard library that typescript provides.

* Remove a few more node.d.ts references
2017-02-01 12:34:50 -08:00
Martin Aeschlimann
d133a5e17c [coffeescript] switch to atom/language-coffee-script. Fixes #14953, #14945, #15008 2017-01-31 22:44:17 +01:00
Matt Bierner
ab91538237 Small cleanup of markdown extensions.ts 2017-01-31 11:47:40 -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
Matt Bierner
7c96cd3c4a Support Fragments for intra document markdown editor links (#19639)
Adds support for editor links with fragements for markdown. This jumps to the correct header location if one can be found
2017-01-31 11:05:06 -08:00
Martin Aeschlimann
60bbe61489 [css] change grammar to atom/language-css 2017-01-31 17:10:28 +01:00
Matt Bierner
15c2d1f51e Move markdown preview content provider to own file (#19592) 2017-01-30 12:36:43 -08:00
katainaka
e68ab660a3 Update markdown-it version (#19417) 2017-01-27 14:41:15 -08:00
Matt Bierner
f7697a7f37 Support In-Document links inside of the markdown editor (#19411)
* Support In Document links inside of the markdown editor

Fixes #17288

* Cleaning up code to reduce duplication
2017-01-27 14:36:28 -08:00
Matt Bierner
6fe2bae3b5 Fixes Webview reload Flickering (#19394)
**Bug**
When refreshing a webview, a slight flicker can sometime be seen. This is especially noticable when using the markdown preview.

**Fix**
Instead of replacing the content of the iframe for refresh, create a new iframe with the new content and do a swap to update.
2017-01-25 13:00:58 -08:00
Matt Bierner
fbea777a88 Fixes #19196 - Disable double click on links in markdown preview 2017-01-24 22:51:24 -08:00