-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow re-rendering Markdown preview when updated extra configurations provided by extension #70936
Comments
PRs welcome to make the refresh command re-render |
Reproducible for me, can I work on the PR? |
The problem happens with cached tokens here It makes a decision whether to recalculate tokens based on the document version and markdown extension configurations. But it doesn't consider changing configurations of markdownItPlugins. There are two possible solutions I see:
@mjbvz , maybe you can help me with a decision. |
IMO I prefer 2, a controllable way in per extension. Some settings defined in Markdown extension would not require clearing cache. I'm afraid to degraded performance. In addition, I have an extension that must trigger re-rendering Markdown by VSCode native configuration |
@vitaliymaz I'm in favor of the second approach as well: making the |
@mjbvz, thank you for the feedback. Working on the second approach. |
Fixed by #71442 |
Thanks @mjbvz, and @vitaliymaz's awesome work! I'll start to test in the next insider version. Cheers 🍻 UPDATE: 1.34 is getting work 😄 |
If Markdown extension provides some extra settings to affect the rendering of Markdown, it would want to re-render Markdown preview when changed configuration values. In fact, VS Code built-in configurations (e.g.
markdown.preview.breaks
) will behave like that. (Tested in 1.33.0-insider)I have met with such a case while creating a Markdown extension that has configurable rendering, but I could not find a way to re-trigger Markdown rendering manually.
markdown.preview.refresh
command is meaningless because it just refresh WebView and not triggered a rendering process.Thus, user have to change Markdown buffer once for previewing with updated configurations. Probably many users would expect to reflect the changed configuration to preview immediately.
It would be awesome if there was a command (or API for extension) to re-trigger rendering of Markdown.
The text was updated successfully, but these errors were encountered: