Commit Graph

50 Commits

Author SHA1 Message Date
Matt Bierner 0532a3429a Fix markdown preview section links
Fixes #40877
2018-01-02 10:43:16 -08:00
Matt Bierner 55382a106f Cache code-line elements for md scroll-sync
Fixes #19092
2017-12-18 14:25:39 -08:00
SteVen Batten f929c1bff4 updating the md scroll sync to use binary search over linear search (#40401) 2017-12-18 10:45:45 -08:00
Matt Bierner 6ccc79823d Fix fragment name 2017-12-12 18:12:57 -08:00
Matt Bierner 4d42f3d7af Support extension-less links in the markdown preview
Fixes #39945
2017-12-12 17:04:29 -08:00
Matt Bierner 34c44f872c Add way to disable markdown preview security warnings in a given workspace
Does not effect the content security level, only toggle the warning popup

Fixes #32251
2017-11-16 18:39:06 -08: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 75eadfbd4b Fix scroll restoration in webviews 2017-08-03 22:22:29 -07:00
Matt Bierner 6a10043e8d Block svg images in markdown preview by default 2017-07-24 18:01:23 -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
Matt Bierner 799fa528db Load script async in markdown preview 2017-05-17 17:39:00 -07:00
Dominic Valenciana e60ea34adc Nested code lines now no longer display the hover border left. (#24686)
* Nested code lines now no longer display the hover border left.

* Added fix for both light and hc themes.
2017-04-13 11:05:35 -07:00
Matt Bierner e392265ce1 Switch md button to open to side by default
Fixes #21511
Fixes #23922

Changes the default markdown toolbar item to open the preview to the side of the current file as requested by #21511

Also updates the single file preview icon slightly to better differentiate it from the diff icon
2017-04-10 17:43:02 -07:00
Matt Bierner 736e09ab7c Use load event listener instead of onload in markdown preview 2017-04-10 17:14:42 -07:00
Matt Bierner 96b49f6f7d Tweak HTML Preview Styling (#24280)
Two changes:

* Changes the logic from 41467b74b7 to make the padding customizable. The default 20px padding is preserved, but now preview can customize if they want to use it or not. This allows html preview page background colors to correctly fill the entire frame.

* Remove Writing the `_defaultStyles` to the root of the webview elment. These are only needed inside of the iFrame itself
2017-04-10 11:03:43 -07:00
Matt Bierner 62e989849b better support nested lists for markdown scroll sync 2017-03-07 17:07:22 -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 3da42e5659 Debounce markdown selection update events Fixes #19827 2017-02-09 17:55:59 -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 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
Matt Bierner dbb77f1eef Smooth markdown scrolling 2017-01-24 22:22:51 -08:00
Matt Bierner 042285d5e1 Fixes active selection line now showing is slection tracking is disabled in markdown preview] 2017-01-24 19:41:34 -08:00
Matt Bierner eba0fc96ff Fixes #19192 - markdown scroll selection sync setting disabling double click and other features 2017-01-24 19:37:13 -08:00
Matt Bierner 311adff0c9 Add more contrast to dark theme current line indication in markdown preview fixes #19323 2017-01-24 18:51:35 -08:00
Matt Bierner 8396a11dab Remove markdown logic to maintain position on resize since it is too choppy 2017-01-24 18:15:24 -08:00
Matt Bierner e7730e36a5 Scroll sync for list items and quotes fixes #19151 2017-01-24 15:46:01 -08:00
Matt Bierner c8196b5ee5 Fixes #19126 2017-01-24 13:58:52 -08:00
Matt Bierner a9424c71e4 Improve markdown preview line indicator colors 2017-01-23 15:24:53 -08:00
Matt Bierner 93c4b5f077 Fixes #19093 2017-01-23 14:12:52 -08:00
Matt Bierner a18fe04303 Add throttle for markdown scroll sync 2017-01-23 13:51:28 -08:00
Matt Bierner 6053021a6c Split up and rename Markdown Scroll Sync Settings (#19077)
Splits the markdown scroll sync settings to be more granular.
2017-01-23 11:59:12 -08:00
Matt Bierner bc27d5c88e Restore double click to switch to editor behavior 2017-01-22 01:04:18 -08:00
Matt Bierner 5bf8cc7618 Add Markdown Preview to Editor Scroll Syncronization
Adds an initial implementation of scroll synrconization from the markdown preview to the editor. When the preview is scrolled, automatically scrolls the editor to reveal the same location.

This required adding a new supported reveal type `AtTop` in our API. This is already supported and used internally, but not really exposed in the public apis (except for the `revealLine` command).
2017-01-22 00:47:06 -08:00
Matt Bierner a02320ba80 Fixes md preview to editor sync when before first element in preview (#18959)
* Fixes md preview to editor sync when before first element in preview

* Fix potential undef reference
2017-01-20 17:23:21 -08:00
Matt Bierner 242affa6e7 Fix reveal of source line on load in markdown preview 2017-01-19 18:13:07 -08:00
Matt Bierner cc4833d868 Improve preview to editor mapping (#18816) 2017-01-19 16:11:34 -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 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 https://github.com/Microsoft/vscode/commit/41467b74b7e486f3a5857d3cc0ab15d85a2b7a84 . 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 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
Matt Bierner 3b8ec4a12f Fix Markdown Preview Code in Header Font Size
**Bug**
In Markdown preview, code blocks in headers are the wrong font size.

**Fix**
Specify that code blocks in headers should inherit their font-size, instead of brining their own.
2016-09-26 10:35:25 -07:00
Johannes Rieken eb2b0d1a15 deliver and wire in icons, #8111 2016-06-28 16:31:50 +02:00
Johannes Rieken 8c2fb77935 add icons for preview and view source 2016-06-16 11:40:52 +02:00
Johannes Rieken 4c15a778e1 save preview icons before deletion begins 2016-06-16 09:48:59 +02:00
kieferrm 591d4f3521 add OSS license details 2016-06-15 11:12:04 +02:00
kieferrm 2ed9c43616 use 'api' friendly css classes 2016-06-15 09:47:30 +02:00
kieferrm 0b856de5a7 prepackage markdown extension 2016-06-14 15:01:58 +02:00