-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Description
Description
Truncation works just fine, but the only place where I found the truncated text inside the match object was in match.buildTag().innerHTML, the link in .getAnchorText() isn't truncated.
Based on the source code, it happens because truncation is performed only inside the tagBulder, so in my case (I wanted to process matches manually, with custom safety checks) it wasn't performed at all.
Steps to reproduce
const matches = Autolinker.parse("https://www.example.com/some-very-long-link/with/a/long/path", {truncate: 20});- There is no truncated link inside the
matchobject. The link insidematch.buildTag().innerHTMLrequires substring replacement:
match.buildTag().innerHTML.replace("…", "...")Metadata
Metadata
Assignees
Labels
No labels