User tests: Successful: Unsuccessful:
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.
var_dump($article);
["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>
.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Front End com_content |
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?
You also assume that intro/full text are both HTML - which is not always (but mostly is) the case.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-21 06:45:51 |
Closed_By | ⇒ | shur |
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