Commit Graph

46 Commits

Author SHA1 Message Date
Matt Bierner a8951772be Clean up markdown preview fixHref to take resources instead of markdown uri 2017-08-29 16:16:53 -07:00
Matt Bierner a271fa97a2 Fix markdown.styles not resolving relative to root
fixes #33455
2017-08-29 16:13:23 -07:00
Matt Bierner 931992aea8 Set charset on contributed markdown scripts 2017-08-28 18:01:23 -07:00
Andrii Melekhovskiy 8d9778b191 Fix typo in Markdown Preview security warning message (#32989) 2017-08-22 17:05:28 -07:00
Johannes Rieken 7128eb085c style - use single-quoted imports 2017-08-21 16:45:32 +02:00
Matt Bierner cb1797f1ef Revert "Don't scroll to factional line positions in the markdown preview when wordwrap is off"
This reverts commit 5055bb7ba4.
2017-08-16 14:54:53 -07:00
Matt Bierner 5055bb7ba4 Don't scroll to factional line positions in the markdown preview when wordwrap is off 2017-08-16 14:50:53 -07:00
Matt Bierner f980319f5c Add markdown preview refresh command
Fixes #32111
2017-08-07 20:21:16 -07:00
Matt Bierner 1d000145c3 Use @types and import in markdown extension 2017-07-21 14:58:27 -07:00
Matt Bierner b62f3d41e1 Update markdown extension to support multiroot 2017-07-17 13:32:42 -07:00
Matt Bierner 80f11c09f0 First cut of new markdown securty levels 2017-07-17 11:19:16 -07:00
Rohith Reddy Kumbharkar e9ec53eb7a Added functionality to toggle break rendering mode for markdown preview (#28713) 2017-06-15 17:24:47 -07:00
Matt Bierner 2af6c114c3 Fix markdown wordwrap for langugae specific settings. Fixes #25357 2017-06-07 15:42:06 -07:00
Matt Bierner 6e8b0229b8 Enforce a minimum for markdown.preview.fontSize
Fixes #27797
2017-06-02 14:45:04 -07:00
Matt Bierner 87c24f2b26 Fix markdown preview csp failure. Fix #27156 2017-05-23 11:57:07 -07:00
Matt Bierner 7403245d3d Show Warning When a markdown.styles fails to load (#27105)
Fixes #8488

**Bug**
Currently there is no indication in the markdown preview when a `markdown.styles` element fails to load

**Fix**
Show an alert then a stylesheet does not load
2017-05-22 18:30:24 -07:00
MaruyamaTomoki 3e65e255ab Markdown preview support the UNC path files. (#26710) 2017-05-22 15:29:25 -07:00
Matt Bierner 799fa528db Load script async in markdown preview 2017-05-17 17:39:00 -07:00
Matt Bierner 405271c17d Move getting active line out of inner openTextDocument 2017-05-16 16:57:26 -07:00
Matt Bierner 087a2d2f24 Default to not updating scroll position if no valid editor is found. Part of #25910 2017-05-16 14:05:10 -07:00
Matt Bierner d13f3e79c8 Fix markdown preview no longer marking selection Fixs #25802 2017-05-04 09:14:34 -07:00
Matt Bierner 891bb7680f Update markdown wordwrap for new wordwrap settings. Fixes #25357 2017-04-26 22:27:28 -07:00
Matt Bierner 740f662023 Allow markdown security setting for single file opens Fixes #24749 2017-04-19 22:31:50 -07:00
Matt Bierner efd3efcb62 Added markdown trace option for debugging user issues Fixes #24983 (#24985) 2017-04-18 18:57:01 -07:00
Matt Bierner 200c4d1057 Fix Markdown Preview Updating on Zoom / Unrelated Config Changes (#24809)
Fixes #24808

**bug**
Markdown preview updates when you zoom. The root cause is that previews are updated whenever the config is changed.

**Fix**
Extract preview config to its own well defined object. Only update the preview when the keys we care about in the config change
2017-04-14 15:43:32 -07:00
Matt Bierner c7c350a68a Small formatting cleanup in markdown 2017-04-13 15:26:32 -07:00
Matt Bierner e4b5586557 Ensure we use an encoded URI for the markdown styles 2017-04-11 15:18:16 -07:00
Matt Bierner f93afc56ce Fix Markdown style paths possibly being handled incorrectly on windows Fixes #3613 2017-04-11 15:16:40 -07:00
Matt Bierner 97a77a0eb3 Add marker class to markdown preview body to allow better css styling overrides 2017-04-06 17:34:04 -07:00
Matt Bierner 81f06c8605 Split markdown security selector into own file 2017-04-04 19:32:36 -07:00
Matt Bierner 16876b257d Revert to using full uri for markdown scroll sync 2017-04-04 16:08:57 -07:00
Matt Bierner 1d876bbc67 Fix a few potential file path casing issues for markdown preview 2017-04-04 14:51:02 -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 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 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 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 7a82ac3ff9 Small markdown code cleanup 2017-02-15 14:49:41 -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 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 15c2d1f51e Move markdown preview content provider to own file (#19592) 2017-01-30 12:36:43 -08:00