Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve visually hidden text within license link #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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