I’ve been converting a K2 project over to K3 and have noticed a little glitch in the way that links are stripped out of blocks of text when using excerpt() in K3.
I’m using markdown to add links to the text field in my content files, and have been using the following code to trim down that text when it’s displayed in a search result:
$result->text()->excerpt(140)
In K2, the search results look like this:
In K3, if a markdown link is followed by a punctuation mark (such as a period or comma) and that link gets stripped from the text, an extra space gets inserted between the originla linked text and the punctuation.
In the example below, the words “cursor”, “input”. and “tapped” were all linked in the the original text field.
Can I assume that this is a bug in the excerpt() method?