? Pending

User tests: Successful: Unsuccessful:

avatar shur
shur
20 Sep 2021

Found a problem with the addition of an extra space character. For example, if the article contains only introtext (with several paragraphs) and no fulltext. Then $item->text will be 1 longer due to the added space character.

Testing Instructions

var_dump($article);

Actual result BEFORE applying this Pull Request

  ["introtext"]=>
  string(780) "<p>***trick.</p>"
  ["fulltext"]=>
  string(0) ""
  ["text"]=>
  string(781) "<p>***trick.</p> "

Notice the line length 761 and now the line no longer ends with </p>.

avatar shur shur - open - 20 Sep 2021
avatar shur shur - change - 20 Sep 2021
Status New Pending
avatar shur shur - change - 20 Sep 2021
The description was changed
avatar shur shur - edited - 20 Sep 2021
avatar shur shur - change - 20 Sep 2021
The description was changed
avatar shur shur - edited - 20 Sep 2021
avatar shur shur - change - 20 Sep 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Sep 2021
Category Front End com_content
avatar PhilETaylor
PhilETaylor - comment - 20 Sep 2021

I would argue this space is needed when concatenation of the intro and full text takes place else you end up with

…this is the end of the intro textThis is the start of the full text….

maybe a check can be made of the fulltext to see if it contains anything and if it does ONLY then pretend the space

avatar shur
shur - comment - 20 Sep 2021

If it looks like this (and most often it does), then I see no problem.
…this is the end of the intro text</p><p>This is the start of the full text….

I am currently working on one content plugin that divides an article into parts by the </p> tag. And for a very long time, I could not understand where this space character comes from, when it is absent in the database.

While saving introtext and fulltext in the database, we use trim several times to remove all unnecessary ... and then add this space.
Hmm, is it really all right here? and it doesn't need to be reconsidered?

avatar PhilETaylor
PhilETaylor - comment - 20 Sep 2021

You also assume that intro/full text are both HTML - which is not always (but mostly is) the case.

avatar shur shur - change - 21 Sep 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-09-21 06:45:51
Closed_By shur
avatar shur shur - close - 21 Sep 2021

Add a Comment

Login with GitHub to post a comment