Commit Graph

210 Commits

Author SHA1 Message Date
Joyce Er
efd055b8ba Refresh markdown preview on all file changes (#138301)
* Refresh markdown preview on all file changes

* Don't watch `https`, `http`, and `data` uris
2021-12-06 12:36:22 -08:00
Matt Bierner
23090cfde3 Force update the md preview when a file on disk changes 2021-11-09 16:14:04 -08:00
Matt Bierner
516bc19e99 Fix md preview reverting to original version when switching away 2021-11-03 20:54:21 -07:00
Matt Bierner
a046cfb481 Revert "Remove image stabilizer code"
This reverts commit 69e8e3c091263a2e00592cca06bf1dba96b70c7e.
2021-11-03 14:48:48 -07:00
Matt Bierner
1f3f74f4ea Clear this._fileWatchersBySrc 2021-11-03 14:48:47 -07:00
Matt Bierner
86c446baee Don't update icon path so much
We only need to update this on creation, never every time something changes
2021-11-03 14:48:47 -07:00
Matt Bierner
9c2b239e2e Remove image stabilizer code
Should not be required with incremental dom updates
2021-11-03 14:48:46 -07:00
Matt Bierner
359cd4330d clean up onDidChangeActiveTextEditor
Also fixes potential bug if line === 0
2021-11-03 14:48:46 -07:00
Matt Bierner
97e646c0da Update preview if text document is reopened
Fixes #135568
2021-11-03 14:48:45 -07:00
Matt Bierner
8f672cac62 Use morphdom to reduce number of full page updates to md preview
This should help improve scroll sync and also reduce the number of times we go out to the network if images are in the preview
2021-11-01 15:33:00 -07:00
Matt Bierner
a9bc0553f7 Support definition links with spaces
For #136073
2021-11-01 09:23:03 -07:00
Matt Bierner
830987eac3 Refactor document link opening
- Extract out of command
- Try to preserve uri instead of converting to path
- Better handle case with absolute file path when there is no workspace
2021-10-13 19:27:35 -07:00
Matt Bierner
d1f72b5420 Try to clairify how md links are resolved
For #101203

The current logic ends up tossing out the uri scheme and other important info when opening md links. This PR tries to avoid that
2021-10-13 19:00:19 -07:00
Lemmingh
d3ceb35bec Add source map for every possible element in the Markdown preview (#134799)
* Update markdown-it and type definitions

* Refresh the source map mechanism in `markdownEngine.ts`
2021-10-12 16:25:56 -07:00
Logan Rasmussen
35ea6c0cf5 Remove angle brackets when checking the scheme (#133419)
* Remove angle brackets when checking the scheme

This only removes the brackets during the scheme check if the initial link provided actually has angle brackets.

* Move angle bracket logic to document link file

Change to use replace instead of match for easier reading
2021-10-04 08:31:52 -07:00
Matt Bierner
e43d47e852 Add missing await
Doesn't seem to cause any issues currently
2021-09-14 09:54:05 -07:00
Matt Bierner
c62f59fcae Fix map func not having this bound
Fixes #132703
2021-09-09 15:03:30 -07:00
Matt Bierner
0e52275271 Introduce WebviewOptions.forms
Fixes #132157
2021-09-02 13:24:49 -07:00
Matt Bierner
af39918361 Organize imports in md ext 2021-08-03 13:22:46 -07:00
Matt Bierner
5f45df8330 Fix formatting
Github merge UI :'(
2021-08-02 19:54:03 -07:00
Nicholas Rayburn
72d9aa625e Fix #124276 batch markdown file requests (#124545)
* fix #124276 batch markdown file requests

* cleanup and modify return type

* Revert "cleanup and modify return type"

This reverts commit 62d62b4947.

* cleanup getAllMarkdownDocuments

* fix markdown batching

* fix var not being modified
cleanup function call
remove modulo use

* don't create a new array on each iteration

Co-authored-by: Matt Bierner <matb@microsoft.com>
2021-08-02 19:44:56 -07:00
Matt Bierner
134c345351 Try adding browser specific tsconfig
Trying to add this to catch dependencies we take on node types
2021-07-22 17:00:17 -07:00
Matt Bierner
ff922dc231 Use TextDecoder instead of Buffer
Fixes #129165
2021-07-22 13:36:22 -07:00
Martin Aeschlimann
7927075f89 Merge pull request #128545 from microsoft/joh/webpack5
Adopt webpack 5
2021-07-14 22:32:54 +02:00
Matt Bierner
5b8ce768f3 Add getNonce function to generate webview nonces 2021-07-13 10:02:24 -07:00
Martin Aeschlimann
7ebe6a6054 adopt web extensions to webpack 5 2021-07-08 21:41:03 +02:00
Andrea Mah
1664732e44 separated editor scroll info by type and consume entry on access 2021-06-14 13:34:41 -06:00
Jean Pierre
be8745ac9e Fixes #123228 (#123584)
Co-authored-by: Matt Bierner <matb@microsoft.com>
2021-05-21 14:51:18 -07:00
Matt Bierner
6ee883bfa3 Split href before decoding instead of after
Fixes #123228

This fixes the case where `#` appears in the path
2021-05-21 14:49:46 -07:00
Matt Bierner
77ff6eb03b Add image specific link normalizer (#124400) 2021-05-21 14:42:50 -07:00
Andrea Mah
41606da2dc removing unecessary spaces 2021-05-19 16:59:26 -06:00
Andrea Mah
9ee1906718 pr feedback and combining prevEditor info for preview and non-preview 2021-05-19 16:57:12 -06:00
Andrea Mah
3dec3b3385 applied PR feedback 2021-05-13 12:30:10 -06:00
Andrea Mah
d2894562d5 fixing issue with static scroll alongside text editor 2021-05-12 17:59:00 -06:00
Andrea Mah
18950181eb scroll state persists while toggling between static preview and text 2021-05-12 16:59:57 -06:00
Andrea Mah
927e791753 Fix Initial Scroll Position on Markdown Dynamic Preview (#123613)
* added semicolons to pass code check

* removed preliminary work for static preview

* cleanup

Co-authored-by: Andrea Mah <t-andreamah@microsoft.com>
2021-05-11 17:12:19 -07:00
Sang
e5c466f587 markdown-language-features: Fix Windows Preview Link Uri (#120090)
* markdown-language-features: fix windows file uri

* refactor: use Uri.joinPath instead
2021-04-19 17:31:07 -07:00
Matt Bierner
d5f4e119e0 Use Array.from's map directly instead of a second call to map 2021-04-12 14:42:39 -07:00
Matt Bierner
73ae56b82b Build with latest TS nightly (#120690)
* Pick up new TS 4.3

Also tests adding override keywords for extensions as part of #120675

* Update to daily TS and workaround TS 4.3 issue

Works around https://github.com/microsoft/TypeScript/issues/43578
2021-04-07 12:19:05 -07:00
gregvanl
975115a2cb Setting descriptions typos and formatting 2021-03-25 10:17:31 -07:00
Habib Karim
9f08368e92 Handle normalized absolute file paths on markdown preview link click (#116649)
* Handle normalized absolute file paths on markdown preview link click #115812

* Parse file path using vscode.Uri
2021-02-18 19:07:22 -08:00
David Sanders
7b317afd93 Fix starting scroll for URIs with fragment (#111126) 2021-01-22 17:41:25 -08:00
Henning Dieterichs
1f8643ef76 Refresh Images In Markdown Preview On Change (#114083)
* Refresh Images In Markdown Preview On Change (implements #65258).

* Fixes tests.

* Implements etags.

* Adds tests for urlToUri.

* Updates doc comment.
2021-01-19 18:01:21 -08:00
meganrogge
0f33afa9f9 fix #112217 by replacing look behinds 2020-12-14 10:30:45 -08:00
Matt Bierner
79557ebbd2 Make sure markdown preview is updated if on disk file is updated
Fixes #111685
2020-12-09 14:08:15 -08:00
meganrogge
a2193cb827 fix #111714 2020-12-02 10:10:21 -08:00
meganrogge
5e54da666c fix #111675 and #111673 2020-12-01 17:03:47 -08:00
Erik Krogh Kristensen
7a4e81a674 fix catastrophic backtracking when parsing markdown files (#109964) 2020-11-10 14:56:06 -08:00
Megan Rogge
63d15a97c7 Support character markup in mardown smart select (#110195)
* create tests and add selection functions for inline ranges
2020-11-10 11:38:27 -08:00
David Sanders
fcef0e3db4 Use Array.flat() (#110189) 2020-11-09 12:46:26 -08:00