mahmoud/chert

Opening links in new tab/window

hristog opened this issue · 4 comments

It would be good if a functionality, similar to what's apparently becoming standardized, gets introduced.
One of the most straightforward - yet inconvenient - workarounds at the moment appears to be using the (un)good old <a href="url" target="_blank">text</a> HTML syntax.

You read my mind! I've been wanting this feature for a while. I can vaguely recall having a plan to add an HTML postprocessing step to reuse the parse tree for both ToC/heading link generation, as well as tab opening.

FYI, I plan on adding a config var open_links_with three modes, with values "all", "none", or "external" (the default).

Thanks for your response. Adding a config item for controlling link behaviour would be great!

Just released the newest version of chert (0.3.0), which has this behavior. Personally, I prefer an automatic, consistent behavior globally than having to go back and rewrite all my old posts to have the proto-standard syntax from the stack overflow answer above. That said, if chert's markdown implementation adds support, happy to upgrade in order to have that syntax, too!

Thanks again for the reminder and the motivation. Let me know if you have any feedback on the behavior!

Yes, I completely agree with you that having to re-write existing posts (even if it were to be done in an automated way) would not have been the most elegant solution, given that this particular syntax hasn't become a feature of chert's markdown yet.
Thanks for releasing the latest version - will check it out asap.