No Code Attached Yet a11y bug
avatar Valdnet
Valdnet
29 Aug 2022

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.

avatar Valdnet Valdnet - open - 29 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 29 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Aug 2022
avatar ReLater
ReLater - comment - 29 Aug 2022

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.

avatar brianteeman
brianteeman - comment - 29 Aug 2022

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

avatar chmst chmst - change - 29 Aug 2022
Labels Added: a11y
avatar chmst chmst - labeled - 29 Aug 2022
avatar ReLater
ReLater - comment - 29 Aug 2022

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.

avatar brianteeman
brianteeman - comment - 29 Aug 2022

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.

avatar ReLater
ReLater - comment - 29 Aug 2022

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>...

avatar brianteeman
brianteeman - comment - 29 Aug 2022

That's the behavior since ever.

then its always been a bug

avatar N6REJ
N6REJ - comment - 29 Aug 2022

@brianteeman apparently this was introduced in J! 2.5 https://blog.crosborne.uk/truncstring-joomla-bug

avatar brianteeman
brianteeman - comment - 29 Aug 2022

thanks - will read it in the morning

avatar N6REJ
N6REJ - comment - 29 Aug 2022

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 . '...';
            }
avatar N6REJ N6REJ - change - 29 Aug 2022
Labels Added: bug
avatar N6REJ N6REJ - labeled - 29 Aug 2022
avatar Valdnet
Valdnet - comment - 30 Aug 2022

@N6REJ You should also remember about text strings that come with three dots, such as:

COM_MEDIA_SEARCH="Search..."

Additionally, the ellipsis should be separated by a space.

avatar ReLater
ReLater - comment - 30 Aug 2022

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>
avatar brianteeman
brianteeman - comment - 30 Aug 2022

It actually happens very rarely in core. But there are solutions available.

avatar brianteeman
brianteeman - comment - 6 Sep 2022

@laoneo it looks like you have addressed this exact bug in dpcalendar

avatar laoneo
laoneo - comment - 7 Sep 2022

Did I? Not sure what you mean...

Add a Comment

Login with GitHub to post a comment