Currently it seems that all external links in content are opened by default in new tabs. It would be nice if that were configurable, because there's a general consensus that it's bad for accessibility.
The link behavior seems to be a core part of
<Link/>
:
("External links also work, and automatically have these props:
target="_blank" rel="noopener noreferrer".
" as of 2.0.0-beta.17)
It looks like controlling the target of external links in the sidebar is planned -- https://docusaurus.io/feature-requests/p/support-target-for-sidebar-links -- maybe for navbars too? (At the moment
target
isn't listed as an available option on either.)
But even if that ability lands, what I'm talking about is the default behavior of links within content pages. Overriding the default behavior would currently require using HTML
<a>
elements instead of standard Markdown links -- on every link.
Evidence on why opening new tabs automatically is bad for a11y is pretty voluminous, but here's a quick rundown of links:
I'm not suggesting here to change the default behavior (although I'd be in favor of that), just to give Docusaurus users the ability to control this behavior. Especially since the current behavior will result in failure of WCAG 2.0 AA level and the UK gov'ts accessibility guidelines, as noted above.
If for some reason you cannot provide control over this behavior, it would be nice to at the very least inform screen readers that these links will be opening a new tab using screen-reader-only text (CSS off-screen -- detailed here https://codersblock.com/blog/external-links-new-tabs-and-accessibility/#how-to-inform-your-users )
Thanks for considering.