User tests: Successful: Unsuccessful:
the previous regex destructively strips the article text from the first <hr />
on a page to the next <hr class="system-pagebreak" />
if content does not contain TinyMCE type line-breaks.
Pull Request for Issue #14531 .
contain page-break regex to a single <hr ... />
current regex will match
<hr /><p>paragraph under first hr tag</p><hr /><p>paragraph under second hr tag</p><hr class="system-pagebreak" />
create an article with an <hr />
anywhere prior to an <hr class="system-pagebreak" />
and display on front-end.
test article exhibiting problem and fix
<p>first paragraph</p>
<hr id="system-readmore" />
<p>second paragraph</p>
<hr />
<p>third paragraph</p>
<hr />
<p>fourth paragraph</p>
<hr class="system-pagebreak" />
<p>fifth paragraph</p>
<hr />
<p>sixth paragraph</p>
[update 2017/03/13]
the test article actually works with line-breaks but not without them which can occur with any DOMDocument type processing or content created by API instead of directly with TinyMCE. so the following article HTML will exhibit the problem if entered directly into the #__com_content
table.
<p>first paragraph</p><hr id="system-readmore" /><p>second paragraph</p><hr /><p>third paragraph</p><hr /><p>fourth paragraph</p><hr class="system-pagebreak" /><p>fifth paragraph</p><hr /><p>sixth paragraph</p>
[end update]
no stripping of article content
output from test html above
first paragraph
second paragraph
------------------
third paragraph
------------------
fourth paragraph
« Start Prev 1 2 Next End»
html between <hr />
and page break is stripped.
output from test html above
first paragraph
second paragraph
« Start Prev 1 2 Next End»
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
@franz-wohlkoenig i added test html above.
<p>first paragraph</p>
<hr id="system-readmore" />
<p>second paragraph</p>
<hr />
<p>third paragraph</p>
<hr />
<p>fourth paragraph</p>
<hr class="system-pagebreak" />
<p>fifth paragraph</p>
<hr />
<p>sixth paragraph</p>
@franz-wohlkoenig I now see the reason this is happening on our sites and not for you.
Some plugins we employ have the harmless side-effect of stripping line-breaks by passing the article's HTML text through DomDocument processing resulting in the saveHTML method not maintaining line breaks. We also create some of our content directly via an XML import process using JoomlaCLI which bypasses any TinyMCE line-break rules. The problem I've reported is not apparent in the vanilla Joomla! 3.6.5 install but becomes apparent when for any reason the TinyMCE line-breaks rules are not maintained which is not a general enough solution. This makes the pagebreak plugin unreasonably reliant on the source of the content. This is not a bug per se but the new regex provided offers a more general solution for handling HTML content without assumptions about its source and the placement of line-breaks so I recommend the new regex for generality.
the following content if created directly in the database will exhibit the problem reported:
<p>first paragraph</p><hr id="system-readmore" /><p>second paragraph</p><hr /><p>third paragraph</p><hr /><p>fourth paragraph</p><hr class="system-pagebreak" /><p>fifth paragraph</p><hr /><p>sixth paragraph</p>
any thoughts on this, @maintainers?
Labels |
Added:
?
|
Closing as it is not a core issue
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-09 14:25:10 |
Closed_By | ⇒ | brianteeman |
@brianteeman how is this not a core issue? is it a requirement that all content be created by tinyMCE? is the pagebreak content plugin shipped with joomla no longer maintained as part of the core? it is a bad assumption and should be fixed. it was already approved 6 months ago.
Because as you stated it is the plugins you are using etc that is stripping the required code.
where is it specified that line breaks are required? the regex in question is written very very poorly. it fails if the content does not come specifically and directly from tinyMCE.
i can see no Difference between Article with and -out PR.