Skip to content
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

Forced line break leads to broken editor on load #156

Open
Drivingralle opened this issue Jan 9, 2025 · 1 comment
Open

Forced line break leads to broken editor on load #156

Drivingralle opened this issue Jan 9, 2025 · 1 comment

Comments

@Drivingralle
Copy link

If a forced line break <br> is part of a tag content that has a binding the following notices show up:

Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: br line 2 and h2 in Entity, line: 2 in /wp-content/plugins/create-content-model/includes/runtime/class-content-model-html-manipulator.php on line 28

Warning: DOMDocument::loadXML(): Premature end of data in tag h2 line 2 in Entity, line: 3 in /wp-content/plugins/create-content-model/includes/runtime/class-content-model-html-manipulator.php on line 28

On reloading the content type the tag is missing and block is broken.

The XML parsing has trouble with the <br> tag. If the tag is changed to <br /> the problem is gone.
In my client project I replace the tag on save. Doesn't feels like a good solution.

@Drivingralle
Copy link
Author

A similar error happens if the content of a block with binding is filled with a string containing a forced line break.

Warning: DOMDocumentFragment::appendXML(): Entity: line 6: parser error : Entity 'nbsp' not defined in /wp-content/plugins/create-content-model/includes/runtime/class-content-model-html-manipulator.php on line 142

Sanitizing the post meta value is very tricky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant