-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
com_content Ensure introtext and fulltext are valid html #23242
Conversation
The splitting may caused html to get invalid (missing end tags).
95e48ac
to
196318d
Compare
This type of behavior honestly belongs in a model (or potentially a plugin, but definitely not the table class), and presumably behind some kind of option. This is one of those cases where you're changing user input without any type of communication and even though it has the best of intentions we still shouldn't be doing that. Also, be aware that As far as the |
Thanks for your advice with the plugin 👍🏽 I have put together a simple plugin |
Some 3rd party editors are already trying to do this at browser (client) side, to close and reopen at least 1 parent HTML tag (or all the nested of tags) you were testing with tinymce ? I do not say to make a fix or not at client side |
@ggppdk Yes I have used tinymce. We didn't encountered it our self (a client found this) so we are not 100% sure were the content got pasted from. To replicate you have to use this in Source Edit mode: <div></div> After this all line breaks are new So is this a bug of joomla or tinymce? |
It is definitely not a tinyMce bug, as introtext and fulltext are not related to tinyMce code ... and also a possibility is to make fix at client side, but even in this case it is not tinyMce bug About being a bug or not i would say it is an issue with any core or 3rd party extension |
Even if it is a bug the approach in this PR has too many potential issues to be included in core.
|
TinyMce 4 has "CMS support" with a pagebreak plugin that will close parent tags it also accepts custom text as break https://www.tiny.cloud/docs/plugins/pagebreak/ maybe we can make use of it for Joomla readmore and pagebreak buttons ? |
We need a solution that's either part of Joomla's Editor JavaScript API or a server-side solution. Relying on editor specific plugins isn't portable; the same problem would just crop up if you don't use the core TinyMCE option. |
We had issues with the readmore tag causing the webpage layout to collaps due to unclosed
<div>
Summary of Changes
The content for
introtext
andfulltext
are parsed byDOMDocument
.So no longer invalid html gets saved to database.
Testing Instructions
Try to save following article with a
Readmore
tag.Expected result
The Intro should be:
Or
Actual result
This breaks the article listing.
Documentation Changes Required
None.