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.06k stars 407 forks source link

[Bug]: WYSIWYG editor inserts random, useless HTML #1528

Open atomGit opened 1 month ago

atomGit commented 1 month ago

Operating system

linux

Publii version

0.45.2 (build 16609)

Post editor

WYSIWYG editor

Bug description

WYSIWYG editor inserts seemingly random, useless html at times

  1. here, the text surrounding the 'style' code is all normal weight font ...

<code style="font-weight: var(--font-weight-normal);">

  1. here, the 'span' tag was inserted for no reason (#f2f2f5 is the default color) - also there's the empty 'strong' tags - this is the entire content of the post ...

<p><span style="color: #f2f2f5;">abc<strong> </strong>def</span></p>

  1. <td><strong>Custom (</strong><span style="color: #f2f2f5;"><strong>optional</strong></span><strong>):</strong></td>

  2. <p><code>$ yt-dlp --flat-playlist --print-to-file '&lt;li&gt;%(title)s (&lt;a href="%(url)s"&gt;link&lt;/a&gt;)&lt;/li&gt;' 'playlist.txt' 'https://www.youtube.com/channel/UC-tQIeakd3uaiwjYHSy9Q'</code><code></code><code></code></p>

Steps to reproduce

these issues are difficult to reproduce since they seem to occur randomly

in the 2nd case, i simply entered 'abc' in an otherwise empty wysiwyg editor, then bolded it, then attempted to use the right arrow key to move the caret past the bold text (which doesn't work), then entered 'def', which was bold, so i used the toolbar button to un-bold the text

i have no explanation for the mess created in the 3rd and 4th cases

Tiny's status bar being disabled doesn't help in these cases

Relevant log output

No response