mycore
mycore copied to clipboard
MCR-3098 Limit length of short description to 5000 characters
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. Butmcrstring: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.
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).
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