Can't get links to open in new tab (bis)

Sorry to create a new post about this but the issue seems very old and was posted in many places (eg. and I could not find a way to make target="_blank" work in a html link yet.

I do not like that users leave the github page when clicking such link and would prefer that they get a new tab to see the result.

My example would be like this:

blah blah <a href="<repo>/<path>/blob/master/<my html file.html" target="_blank">comment</a>**

It now does display the html content all right, but in the current tab rather than in a new one as I would prefer it to behave.

Thanks for any code snip to achieve this or ro add this as a feature requests.


1 Like

Any HTML that is inserted into Markdown to be displayed on a GitHub page is sanitized to prevent security problems. The target attribute on the a tag is one of those items that gets stripped out. Unfortunately, there isn’t a solution for this.

I hope that helps.

1 Like

I don’t like it to!

1 Like