-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code editor not accepting block element (<h3>) inside anchor tag (<a>) #18848
Comments
I can reproduce this 👍 |
Hi @aduth, does this issue rings any bells related to autop? |
It may well be an issue related to gutenberg/packages/blocks/src/api/parser.js Line 444 in 38f4914
... where the <ul>
<li>
<a href='#'></p>
<h3>Title</h3>
<p> </a>
</li>
</ul> I expect that the Freeform block will try to normalize the markup to the best of its abilities, resulting in what is shown as the markup in the original comment. To clarify, this would probably have been an issue for some time already. The
The autop implementation should be updated to conform to expectations of HTML5 specification behavior.
https://w3c.github.io/html-reference/a.html#a-changes In the meantime, possible workarounds include:
|
Closing this one in favour of https://core.trac.wordpress.org/ticket/27350. If and when Core's |
Describe the bug
Whenever editing a page/post through the code editor instead of the visual one and adding a block element inside an anchor tag, whenever focusing out or saving the page, the editor automatically changes the code creating an orphan anchor tag.
To reproduce
Steps to reproduce the behaviour:
Expected behaviour
Since the markup added is valid HTML I would expect it to be kept as is. But instead, on focusing out the editor, it is changed to (adjusted indentation for readability)
However, when publishing, it changes the markup even further to:
Additional context
The text was updated successfully, but these errors were encountered: