Link shortener for internal links?

I recently found the following css snippet which hides the url part of a markdown link unless the cursor is at that location in the text in edit mode:

/*Source: https://santiyounger.com/obsidian-shorter-links/*/

div:not(.CodeMirror-activeline) > .CodeMirror-line .cm-string.cm-url:not(.cm-formatting) {
    font-size: 0;
}
div:not(.CodeMirror-activeline) > .CodeMirror-line .cm-string.cm-url:not(.cm- formatting)::after {
    content: '»';
    font-size: 1rem;
}

So “[link](example.org)” is displayed as “[link](»)” instead. I would like to adapt it so that it works with internal links that have a separate link text (eg. displaying “[[link|This is the linktext]]” as “[[»|This is the linktext]]” instead). Is this possible?

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.