I am using the r package learnr and would like all links (to external material) to open in a new tab. I could probably just add
<base target="_blank">
but I don't know how to add header tags in learnr. I believe this isn't possible in ordinary markdown. I know I can just type the html for each external link but that is a real drag.
Yihui Xie has a helpful post containing a JavaScript snippet to do just this: https://yihui.org/en/2018/09/target-blank/
In the context of a learnr tutorial, you could add Yihui's function using the following
jscode chunk added to the top of your.Rmdsource (above your first level 2 (##) heading).