No Code Attached Yet
avatar hube12
hube12
6 Jul 2020

Steps to reproduce the issue

Take any templates that use jdoc include such as that:
<jdoc:include type="modules" name="topbar6" style="fav"/>
Break it into 2 different lines:

 <jdoc:include type="modules" name="topbar6"
                                                              style="fav"/>

This is still correct syntax however the parser fail on it and will not render the module.

Expected result

The parser should discard the carriage return and read to the end fo the tag.

Actual result

The parser dont read the whole tag and just stop rendering

System information (as much as possible)

Joomla 3.9.19
Windows 10

Additional comments

This bug happened when editing a template inside phpstorm and using the reformat tool that with the hard wrapping at 120 columns will split deep enough include into 2 lines.

avatar hube12 hube12 - open - 6 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Jul 2020
avatar ReLater
ReLater - comment - 6 Jul 2020

One would have to change this regular expression
https://github.com/joomla/joomla-cms/blob/3.9.19/libraries/src/Document/HtmlDocument.php#L746

Adding a s modifier for including newlines, too.

But this will go on: Between jdoc:include and type= exactly 1 white space is allowed. Must be replaced by something like \s+

I'm not a "performance expert" and not able to decide if it's worth to change this restricitive regular expression.

Aren't there possibilities in phpStorm to define reformat/rearrange exclusions?

avatar hube12
hube12 - comment - 6 Jul 2020

@ReLater I fixed my linter in phpstorm but i was just surprised that was the issue when i started debugging it.

avatar joomdonation joomdonation - change - 12 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-12 10:44:31
Closed_By joomdonation
Labels Added: No Code Attached Yet
Removed: ?
avatar joomdonation joomdonation - close - 12 Nov 2022
avatar joomdonation
joomdonation - comment - 12 Nov 2022

As the author of this issue came up with a solution, and no-one else has reported the same issue, I think it is not necessary to make change to the regex (which could introduce unexpected behavior-bugs). With that said, I'm closing this issue so that we can spend time on other more important one. Thanks !

Add a Comment

Login with GitHub to post a comment