GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.35k stars 419 forks source link

[Feature Request]: Super/Subscript Editor Support #1615

Open longview opened 3 months ago

longview commented 3 months ago

Feature Description

It would be really nice if the editor supported superscript and subscript tags.

I often write technical posts with mathematical formulas etc., and currently I have to switch to HTML view and manually add or tags around e.g. log10(x^2) to make it render the way I want (10 subscripted, ^2 should really be ²).

It seems like the editor handles this just fine when I add the tags manually, so I think all that's needed is to add buttons for these tags that work like e.g. the bold/italics buttons.

candidexmedia commented 1 month ago

If you're comfortable doing so, you can modify the WYSIWYG editor based on TinyMCE specs yourself. There's a button option for superscripts and subscripts, but you just need to add it manually:

I have a scrappy guide on making changes to the WYSIWYG editor that might be helpful in terms of knowing what files to edit: https://gist.github.com/candidexmedia/367711a80274b4c005fd5983df97d20c