Commit Graph

19 Commits

Author SHA1 Message Date
Rohith Reddy Kumbharkar
e9ec53eb7a Added functionality to toggle break rendering mode for markdown preview (#28713) 2017-06-15 17:24:47 -07:00
Alex Dima
aca01f2daa Fix build hygiene issues 2017-04-14 14:08:52 +03:00
Matt Bierner
c7c350a68a Small formatting cleanup in markdown 2017-04-13 15:26:32 -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
4f8e68b814 Second prototype of markdown extensions (#22836) 2017-03-20 11:16:18 -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
62e989849b better support nested lists for markdown scroll sync 2017-03-07 17:07:22 -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
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
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
Matt Bierner
dbb77f1eef Smooth markdown scrolling 2017-01-24 22:22:51 -08:00
Matt Bierner
41a5c6858c Remove duplicate calls in markdownEngine 2017-01-24 17:14:15 -08:00
Matt Bierner
e7730e36a5 Scroll sync for list items and quotes fixes #19151 2017-01-24 15:46:01 -08:00
Matt Bierner
4e7666da14 Fix relative links in markdown preview 2017-01-24 11:41:18 -08:00
Matt Bierner
dc614f212d Cleanup markdown extension (#18951)
* Splits symbol provider to own file
* Removes duplicate frontmatter logic
2017-01-20 15:20:37 -08:00
Matt Bierner
94909e76d0 Fixes #18946 (#18948) 2017-01-20 13:22:41 -08:00
Matt Bierner
d85dc993f9 Support Local File Links from the Markdown Preview (#18824)
* Support Local File Links from the Markdown Preview

Fixes #989

**Bug**

* `file://` links do not work in the markdown preview.
* `./file` and `/file` and `file` links do not work in the markdown preview.

**Fix**
For the first issue, allow `file://` links explicitly.

Add a custom link validator. If the incoming link has no scheme, try to resolve it relative to the current file or workspace. Likes like `/file` are relative to the workspace, while links like `file` or `./file` are relative to the current file.

* Fix reveal of source line on load in markdown preview
2017-01-20 12:44:09 -08:00