Vscode extension track changes of html in previewHtml - visual-studio-code

I'm displaying a TextDocumentContentProvider using previewHtml. Is it possible to track the addition of text into the textbox that i'm displaying in this previewHtml ?

We don't do this automatically but your extension can certainly use the previous html preview contents to track changes or generate a diff

Related

Is there a way to detect changes to the content control in word in office js?

I've got a script that finds all matching bits of text and puts them in a content control. I noticed there was a functionality to remove the content control if the text was edited ContentControl.removeWhenEdited = true. Is there a way to run this same trigger/event of when the text content changes, but instead of removing the content control trigger some custom code instead?
I figured since there's already functionality to trigger on the exact event I need, it surely can't be too complicated. I tried ContentControl.onDataChanged = MyFunction() but this only ran the function when the content control was added and couldn't rerun it when the data was infact changed.
Any and all help greatly appreciated!

Vscode extension: insert some meta text on a certain position?

I think it should be possible.
I want to make an extension that will add a specific meta text content on specific positions in the source file (depending on its content), but this content should be just visible to the user not inserted into the source of course.
Can someone point to the VSCode API which I should use for this?
I think I found it:
https://code.visualstudio.com/api/references/vscode-api#TextEditor.setDecorations
This extensions also uses it:
https://github.com/wix/import-cost

Is it possible to refresh the outline view only when file is saved (and not during editing)?

I'm developing a vscode extension for a custom language and I provide symbols by registering a vscode.DocumentSymbolProvider.
I have noticed that my symbol provider is called by vscode every time the content of the current file is changed in order to refresh the outline view.
I would like to change this behaviour to refresh the outline view only when the current file is saved. Is it possible ?
There is no setting for this. If you'd like to see it supported, please file a feature request
However it's entirely up to your extension when and how to compute the outline. Your extension could cache the document symbol data and return the cached version when VS Code asks, only re-computing new document symbol data on file save

Lightbox with ashx extension

I am using the LightBox plugin to display images in modal popups. It all works great in the browser with the specified extensions - png|jpg|jpeg|gif|tiff|bmp|svg - in featherlight.min.js.
I am trying to show images with .ashx extension in the modal window. But all I get is garbled text. I can get around this by adding the .ashx extension the above list.
To make upgrades easier in the future, I would like to avoid modifying the above list and add the .ashx extension outside the featherlight.min.js file. I can't find any samples on how to do that.
Is there a way to accomplish this or I just have to modify featherlight.min.js and add the .ashx extension?
Featherlight supports content filters extension: https://github.com/noelboss/featherlight#content-filters

Tinymce - problem with fontsize using bbcodes

i am using tinymce with the bbcodes-plugin. In generally, its working nicely, most of the bbcodes like [b] and [color] and so forth are transmitted into html within the textarea and safed as bbcodes into the database correctly.
The thing with font-size is the following, when formating a string the first time it is correctly changing its size and is safed correctly as bbcode into the database.
But when i open that record again to edit it, the bbcode is not converted to html, so in the textarea there is something like
"[size= medium]rfeferf[/size]" instead of the text in the right size.
Do you have any hints on this? Ive been searching the web yesterday and today, didnt find anything that could solve this.
Regards, Maschek
This is caused by BBCode plugin in TinyMCE unable to transform [size] tag back to HTML. I've logged a TinyMCE bug #5327 with a fix patch attached. You can download latest TinyMCE source, apply the patch and compile it (or wait until the patch is reviewed and released).
The related source code is located at plugins/bbcode/editor_plugin_src.js