Add ability to open links in comments / text topics in new tabs by default
We've now got a couple options for opening links in new tabs, but the missing piece is also having some way to open links from the text of comments and topics in new tabs as well. This is a bit trickier because that HTML is already pre-generated from parsing the markdown. The options are probably:
- Parse and store a second copy of every post's HTML during markdown parsing, with the links having
target="_blank"
added. - Parse and update the HTML at display-time on the server side.
- Add the
target="_blank"
attrs with javascript for users with the option enabled.
I think doing it in JS is probably the best bet, though a server-side approach might be reasonable if the alternate version was just cached in Redis instead of needing to store it in the database or always generate it on-demand. That's potentially a lot of data to put in Redis for a very minor feature though.