Reocin / obsidian-markdown-formatting-assistant-plugin

This Plugin provides a simple WYSIWYG Editor for Markdown and in addition a command line interface. The command line interface facilitate a faster workflow.
245 stars 27 forks source link

Add custom HTML tags etc. #42

Open jenshda opened 2 years ago

jenshda commented 2 years ago

Thanks for a great plugin and the work you put into this!

Is your feature request related to a problem? Please describe. It's slightly annoying not being able to att your own items to the HTML tags etc.

Describe the solution you'd like An example are the \

tags I use for side notes. These would be fantastic to have included, but at the same time they might be niche tags not perhaps suitable for all users of this plugin. Therefore I would like to request the ability of adding custom HTML tags (or even LaTeX) the same way as is possible with colours at the moment.

Describe alternatives you've considered I've considered using snippets for this of course but it would be so much cleaner and less "hacky" to be able to include it in this plugin.

Additional context Needed for niche tags and formulas only applicable to some users, which might cause the plugin to feel bloated if including all these types of tags etc.

imkzh commented 2 years ago

Seems HTML tags not in some predefined whitelist are filtered, and will not present in the DOM (this is fine, since allowing <script> tag is generally not a good idea.) (but strange, since <script> tags are already handled with different logic compared to other non-whitelisted tags.).

For the use case, I'd like to use <red></red> with a css file to mark text red:

red {display: inline; color: #faa}

instead of using <span class='red'></span> or <span style='color:#faa;'></span> (which is long and ugly in editing mode)

I think it is OK to let users having control of what custom HTML tags are allowed in the document.