elm-book icon indicating copy to clipboard operation
elm-book copied to clipboard

Feature request: a way to make absolute URL markdown links have target=_blank

Open avh4 opened this issue 2 years ago • 2 comments

In general within my styleguide, I'd like to make links to external sites automatically open in new tabs. If target=_blank were automatically added to any markdown links with an absolute URL href, or if there were a Theme/Book/Chapter/etc option to enable that, then I could easily do so. (I'd still want styleguide-internal links (which are all going to be relative URLs) to behave as they currently do.)

avh4 avatar Jan 28 '22 00:01 avh4

I guess alternatively, an option to provide a custom base Markdown.Renderer would also give me a way to do this.

avh4 avatar Jan 28 '22 00:01 avh4

Providing a custom markdown renderer is interesting for a future version but for now it should be easy to add a target blank for all external links (it will throw false positives if the full path is an internal one tho).

georgesboris avatar Jan 28 '22 01:01 georgesboris