-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Html tags are not removed when the block type is changed. #6284
Comments
I can reproduce the issue but I have no idea how we can fix the issue. May be we need callbacks for the each types, not sure. |
I don't think it will feasible to add callbacks/methods for the conversion. Just too many options also with custom blocks. Ideally, the old content would be handed over to the new block type (as is happening now) but then the writer-based blocks would update the content once more from what the writer input output should be (as e.g. the heading writer input should probably strip paragraph tags). But no good idea yet how to make this happen. |
@distantnative It seems that the convert operation is generic. It's an automated process according to the block blueprints. It cannot be specific operation for any type. https://github.com/getkirby/kirby/blob/4.2.0/panel/src/components/Forms/Blocks/Blocks.vue#L274-L326 We cannot process data in block type views. Because they are only triggered by input ( I couldn't find a solution yet either. |
If I change the block type in the block editor, e.g. from "Text" to "Heading", the
<p>
tag is retained:<h1><p>I used to be a text block</p></h1>
If the block type is created directly as a heading, the formatting is correct.
[Tested with Kirby 4.1]
The text was updated successfully, but these errors were encountered: