Closed
Description
Bug Report
When using homepage
to point to an external file, the default configuration automatically adds rel="noopener"
and target="_blank"
attributes to external links. But then, DOMPurify sanitizer removes the target
attribute as it is not in the white list. This completely prevent the opening of external links in history
router mode.
Steps to reproduce
Just point to an external file as your homepage :
window.$docsify = {
homepage: 'https://raw.githubusercontent.com/docsifyjs/docsify/develop/docs/README.md',
}
What is current behaviour
generated HTML for external link is missing "target" attribute :
<li>Support server-side rendering (<a rel="noopener" href="https://github.com/docsifyjs/docsify-ssr-demo">example</a>)</li>
What is the expected behaviour
target attribute should be present
generated HTML for external link is missing "target" attribute :
<li>Support server-side rendering (<a rel="noopener" target="_blank" href="https://github.com/docsifyjs/docsify-ssr-demo">example</a>)</li>
Other relevant information
-
Bug does still occur when all/other plugins are disabled?
-
Your OS: Ubuntu
-
Node.js version:
-
npm/yarn version:
-
Browser version:
-
Docsify version: 4.11.6
-
Docsify plugins:
Please create a reproducible sandbox
Mention the docsify version in which this bug was not present (if any)
Metadata
Metadata
Assignees
Labels
No labels