The spelling of the ellipsis should be corrected in all text strings. Currently, three dots ...
are used which is a spelling mistake. The ellipsis character of the form …
should be used.
Labels |
Added:
No Code Attached Yet
|
The style guide says it should be an ellipsis (https://developer.joomla.org/en-gb-user-interface-text-guidelines/punctuation.html)
Also a screen reader understands an ellipsis but doesnt understand three dots
Labels |
Added:
a11y
|
Also a screen reader understands an ellipsis but doesnt understand three dots
Set the default of my proposed language string to an ellipsis.
Method truncateComplex sets the 3 dots/ellipsis outside of the last HTML tag; e.g. after last <p></p>
.
I think a language string would be the best solution for all needs.
Method truncateComplex sets the 3 dots/ellipsis outside of the last HTML tag; e.g. after last
.
It shouldn't do that. Can you post an example please.
That's the behavior since ever.
$text = '<p>Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo Hello hallo </p>';
$introtext_limit = 35;
echo HTMLHelper::_('string.truncateComplex', $text, $introtext_limit);
==>
<p>Hello hallo Hello hallo Hello</p>...
That's the behavior since ever.
then its always been a bug
@brianteeman apparently this was introduced in J! 2.5 https://blog.crosborne.uk/truncstring-joomla-bug
thanks - will read it in the morning
looking @ the code it looks like it was designed to do that...
// If the new plain text string matches the original plain text string we are done.
if ($ptString === $htmlStringToPtString) {
return $htmlString . '...';
}
// Get the number of HTML tag characters in the first $maxLength characters
$diffLength = strlen($ptString) - strlen($htmlStringToPtString);
if ($diffLength <= 0) {
return $htmlString . '...';
}
Labels |
Added:
bug
|
@N6REJ You should also remember about text strings that come with three dots, such as:
joomla-cms/language/en-GB/com_media.ini
Line 101 in 9df5e6c
Additionally, the ellipsis should be separated by a space.
Just to have it mentioned:
You should keep in mind that simple <p></p>
examples are relatively easy to fix. Find the last closing tag move ... inside.
It becomes more complicated if you work with more complex HTML:
$text = '
<p>Happa heppiu.</p>
<ul>
<li>A1 A1 A1 A1 A1 A1 A1 A1 A1 A1 A1 A1</li>
<li>A2 A2 A2 A2 A2 A2 A2</li>
<li>A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14</li>
<li>B1cdsww B1cdsww B1cdsww B1cdsww B1cdsww B1cdsww B1cdsww</li>
<li>B2weqwewq B2weqwewq B2weqwewq B2weqwewq B2weqwewq B2weqwewq</li>
</ul>
';
$introtext_limit = 100;
echo HTMLHelper::_('string.truncateComplex', $text, $introtext_limit);
=>
<p>Happa heppiu.</p>
<ul>
<li>A1 A1 A1 A1 A1 A1 A1 A1 A1 A1 A1 A1</li>
<li>A2 A2 A2 A2 A2 A2 A2</li>
<li>A3 A4 A5 A6 A7 A8 A9 A10</li></ul>...
instead of
<p>Happa heppiu.</p>
<ul>
<li>A1 A1 A1 A1 A1 A1 A1 A1 A1 A1 A1 A1</li>
<li>A2 A2 A2 A2 A2 A2 A2</li>
<li>A3 A4 A5 A6 A7 A8 A9 A10...</li></ul>
It actually happens very rarely in core. But there are solutions available.
Did I? Not sure what you mean...
I would prefer a language string for the code places where the three dots are used (e.g. in truncate methods, especially truncateComplex). Then everyone can decide for themselves what they want to use. Empty string, icon, 3 dots, ellipsis, whatever.
But I'm against a change in core like hard-coded ellipsis instead of 3 dots.