cryogen-project / cryogen

A simple static site generator written in Clojure
http://cryogenweb.org/
Eclipse Public License 1.0
1.1k stars 96 forks source link

Preprocess links to open them in the new tab #192

Closed zshamrock closed 5 years ago

zshamrock commented 5 years ago

Currently, markdown doesn't allow to specify that link should be opened in the new tab, which means fallback to manual "<a href= target=>" definition instead of markdown syntax.

Would it be possible to pre-process markdown links and generate the corresponding HTML link tag with the target=_blank?

lacarmen commented 5 years ago

Cryogen uses markdown-clj by default (you could switch to a different markdown parser), so it might be better to open the issue there.

Alternatively, you could customize the parser to behave how you want. I use the :replacement-transformers here to inject the blog prefix in front of image links, so you could do something similar to inject target=_blank.

zshamrock commented 5 years ago

Thank you, @lacarmen. Will consider then the option to customize the parser indeed. So close this ticket.