ozntel / oz-image-in-editor-obsidian

This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
339 stars 13 forks source link

Wanted: Tutorial how to fix WYSIWYG issues #78

Closed davidszp closed 3 years ago

davidszp commented 3 years ago

I found some unwanted WYSIWYG side effects with keywords generated by other plugins (e.g. advanced tables or annotations). I think it would be most efficient for us to fix these ourselves instead of asking Ozan to go through 300 plugins to ensure compatibility with all of them.

Say I want to fix the behavior of hiding $ markdown code in case the character is part of a table formula in advanced tables. For example, when inside a table math formula such as <!-- TBLFM: @8$2=(@4$2+@7$2);%.1f --> WYSIWYG should ignore the $ instead of hiding it as it makes the formula unreadable. However, when found in regular text, it should hide it as it already does.

Where in the source do I find the WYSIWYG regex and replacement rules exactly?

ozntel commented 3 years ago

You can find the styles, which are turned on, when you select the WYSIWYG mode under the link:

https://github.com/ozntel/oz-image-in-editor-obsidian/blob/master/src/constants.ts

You can definitely overwrite any of them in your custom css if necessary.