mycore icon indicating copy to clipboard operation
mycore copied to clipboard

MCR-3098 Limit length of short description to 5000 characters

Open Possommi opened this issue 9 months ago • 3 comments

MCR-3098.

Possommi avatar May 08 '24 06:05 Possommi

It doesn't look right to me. The edge case appears to be critical. mcrstring:shorten('123456', 5, '…') => 12345… In General, ellipsis seems to me to be added after the permitted length. The resulting length would then be n + 1 and not n. But mcrstring:shorten('12345', 5-1, '…') => 1234… doesn't seem so elegant either.

I can rollback to the previous version which works and doesnt require an extra include.

Possommi avatar May 08 '24 09:05 Possommi

Using an existing utility function still seem right to me, but, apparently, that function shortens the text to the desired length and then adds the ellipsis, requiring a call like <xsl:value-of select="mcrstring:shorten(text(), $short-description-max-length - 1, '…')"/> (which, imho, is a questionable design decision regarding that utility function that might warrant a separate issue to be opened).

toKrause avatar May 08 '24 09:05 toKrause

This would solve the problem on the part of ORCID. However, I would also question the behavior of mcrstring:shorten. If an ellipsis is specified, I would expect the final length to be equal to the passed length including the ellipsis.

But that could be an extra ticket to speed up the merge of this ticket

Possommi avatar May 08 '24 11:05 Possommi