User tests: Successful: Unsuccessful:
This is a follow up on #23242, but this time not using DOMDocument but just Regex.
With TinyMCE the content is correct (No wrapping tag arround <hr>
) but with JCE for Example the output can be:
JCE tries to mitigate this issue client side and closes both <p>
tags before and after the readmore. But I had to switch between Editor and Code twice. After that the code looks like this:
But sometimes the broken data still hits the database.. and the complete page layout will sometime get broken.
Changed the regex that splits the articeltext
in introtext
and fulltext
.
It will remove the surrounding tags of the readmore tag because other wise the opening tag ends up in introtext
and the closing tag in fulltext
thus breaking the html structure of the site.
Create an Article with following markup (Could replace div
with p
):
<div>Das ist ein Test</div>
<div><hr id="system-readmore" /></div>
<div>Mehr Text</div>
Introtext:
<div>Das ist ein Test</div>
<div>
fulltext:
</div>
<div>Mehr Text</div>
Introtext:
<div>Das ist ein Test</div>
fulltext:
<div>Mehr Text</div>
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
On applying this I get the following Error:
Class 'Joomla\CMS\Table\Observer\Tags' not found
@ReLater It depends of the installed Version of the Editor, also you have to use the xtd-buttons (Bottom ones). We use multiple different Editors (pageBuilderCK with either JCE or TinyMCE) and some times the customer accidentically breaks his hole page just by inserting a readmore...
@ChrisHoefliger Can't explain why a simple change to the Regex which splits the articleText into 2 parts should cause a Class not Found error.
It was stated that something altering the content should sit in a Model instead of the Table\Content Class but even in Joomla 4 it still remains there. But that is out of scope for this simple change.
I should mention that Lists would still be broken:
<ul>
<li>Test</li>
<li><hr class="system-readmore" /></li>
<li>Test</li>
</ul>
will result in
Intro:
<ul>
<li>Test</li>
Fulltext:
<li>Test</li>
</ul>
But the we now would not have a dangling empty list item in the Intro Text.
also you have to use the xtd-buttons (Bottom ones).
You didn't mention that. I deactivate all unnecessary xtd-plugins when using JCE.
It depends of the installed Version of the Editor
One should always use the current version ;-)
From my point of view this should be fixed inside the xtd-buttons and/or editor based instead of using too complicated PHP regexes. If JCE is clever enough, why not others.
But, as always, I don't have to decide that. Just a private opinion.
The "fix" JCE uses is also not optimal, you end up with a <p> </p>
before and after the readmore tag, which also can look weird sometimes (You can't even fix it with a simple css rule of p:empty {display:none;}
because of the Space inside).
IMO: As the CMS is guessing where it breaks the content into the 2 parts it should do it reliable and not depend on Editor Workarounds.
I have tested this item
I have tested this item
Labels |
Added:
?
Information Required
Removed: ? |
I've restored @MUX-ON-WINDOWS 's test result in the issue tracker so it's properly counted. The commit which invalidates the count was just a clean branch update. But the other, first test was almost 2 years ago, and the user has meanwhile left GitHub or has a new account, so I think we can't count that test.
So it needs a 2nd human tester.
I am struggling to understand this PR.
The only way I can create the wrapping div is by typing it in manually.
Using the readmore button never puts in wrapping divs
Before this PR if I try to insert the readmore inside a div it will produce the broken code as described.
After this PR it also produces the broken code as described
First it will put the readmore inside a wrapping <p>
tag and when switching between Code and Editor View it will "fix" the error by closing the tags with a  
inside that would add extra whitespace later.
Both will result in the output to be what the user wanted. We noticed it just because a customer of us has broken his page multiple times because of this.
This Example Code
<p>Hallo</p>
<p>
<hr id="system-readmore" />
</p>
<p>Test</p>
But after the fix, and resaving the same content:
If you switch betwen Editor & Code this fix wont work because JCEs "fix" will already have inserted the Empty Paragraphs before and after the Readmore.
The video demonstration shows an issue with jce. Not an issue with the joomla core editor. It is not reproducable with tinymce and should therefore be closed
I'm here with Brian. Did you report the issue to JCE? Because this change can have some undesired side effects.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-07-05 07:45:50 |
Closed_By | ⇒ | Chrissi2812 |
Hm, I can't reproduce your find that JCE adds
<p>
or<div>
around the<hr>
block element when I insert a readmore. If that would be the case I would say that's a JCE issue.When I have a
<div>Hello.</div>
or a list structure<ul><li>...</li></ul>
and try to add a readmore inside then JCE creates:or