We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you hyphenate an HTML text which has no single root element, the resulting HTML markup is rearranged and broken.
This was introduced with this commit.
It's a known issue of the underlaying XML Lib: https://stackoverflow.com/questions/29493678/loadhtml-libxml-html-noimplied-on-an-html-fragment-generates-incorrect-tags https://stackoverflow.com/questions/4879946/how-to-savehtml-of-domdocument-without-html-wrapper
To Reproduce
hyphenate = Carbon.Hyphen:Html { content = '<p>foo</p><p>bar</p>' }
leads to:
<p>foo<p>bar</p></p>
Expected behavior The resulting markup should stay the same as before the hyphenation.
How to fix The fix is very easy, as it just need some kind of "wrapper" tag to enfoce the HTML to have a single root element.
<div><p>foo</p><p>bar</p></div>
Question is, if this package should handle that autmatically? Or the package integrator needs to take care of this?
I could image to wrap the text internally with a div and remove the wrapper afterwards: https://github.com/CarbonPackages/Carbon.Hyphen/blob/main/Classes/Fusion/Implementation.php#L120-L121
WDYT? @jonnitto If this works for you, I could prepare a PR. Otherwise we should note this somewhere in the docs.
The text was updated successfully, but these errors were encountered:
Thanks for your findings! A PR is very welcome!
Sorry, something went wrong.
jonnitto
dlubitz
Successfully merging a pull request may close this issue.
If you hyphenate an HTML text which has no single root element, the resulting HTML markup is rearranged and broken.
This was introduced with this commit.
It's a known issue of the underlaying XML Lib:
https://stackoverflow.com/questions/29493678/loadhtml-libxml-html-noimplied-on-an-html-fragment-generates-incorrect-tags
https://stackoverflow.com/questions/4879946/how-to-savehtml-of-domdocument-without-html-wrapper
To Reproduce
leads to:
Expected behavior
The resulting markup should stay the same as before the hyphenation.
How to fix
The fix is very easy, as it just need some kind of "wrapper" tag to enfoce the HTML to have a single root element.
Question is, if this package should handle that autmatically? Or the package integrator needs to take care of this?
I could image to wrap the text internally with a div and remove the wrapper afterwards:
https://github.com/CarbonPackages/Carbon.Hyphen/blob/main/Classes/Fusion/Implementation.php#L120-L121
WDYT? @jonnitto
If this works for you, I could prepare a PR. Otherwise we should note this somewhere in the docs.
The text was updated successfully, but these errors were encountered: