Skip to content

Conversation

@thibaudcolas
Copy link

In the current editor output, the sanitize-html filtering causes the visuallyhidden class to be removed:

<a href="https://creativecommons.org/publicdomain/zero/1.0/legalcode" target="_blank">
  Creative Commons Zero v1.0 Universal <span>(opens in a new window or tab)</span>
</a>

I looked at what might be the correct fix based on the sanitize-html docs for allowedClass, but didn’t actually test this code.

There are two alternative fixes here that might be better suited:

  • Remove sanitizeHtml altogether. At least currently this code only outputs content from spdx-license-list, which I’d assume is trusted enough with how they define URLs and license names.
  • Remove the target="_blank" and <span>(opens in a new window or tab)</span> for simplicity.

@mgifford
Copy link
Collaborator

mgifford commented Oct 2, 2024

Interesting.. This looks good. I haven't tested it, but makes sense that it would be a problem in Svelte. Thanks @thibaudcolas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants