The Issue
When creating a header the html created for it when in edit mode looks something like this.

But I’ve found a glitch that when active causes a second blank code block to also be inserted.

To the end-user using default CSS this isn’t something that would be noticed or matters all that much. But it can cause issues when making certain CSS changes. For example, I have some colored Icons I like to display along with my headers to help differentiate them. But this added blank HTML element causes issues and causes my icon to be placed a second time at the end of a header.

To Reproduce
In edit mode create any h1-h6 header. Name it using an inline code block like this and leave a space at the end.
Example: "### Header "
You must leave a space at the very end of the header name outside the last` mark for the error to take place. Don’t include the “” marks
If You want to more easily visually see this change you can add this CSS. It will a * to the front of you’re h1 headers when in edit mode.
.cm-header.cm-header-1:not(.cm-formatting-header):not(.cm-formatting):before{
content: "* ";
color:red;
}
Expected result
Headers that use inline code blocks should not insert a second invisible <span class="cm-header cm-header-x"> </span> element at their end regardless of if there is a space or not.
Testing Info
Devices/OS
- Tested On Windows 10 using various plugins and CSS.
- Tested On Windows 11 using a clean install of the program.
Other Info
- Error shows in both source mode editing mode and live preview editing mode.
-
Not tested with legacy editor