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

🐛 Escape annotated HTML tags in span renderer #12817

Conversation

connorbrinton
Copy link
Contributor

Description

These changes add a missing call to escape_html in the displaCy span renderer. Previously span-annotated tokens would be inserted into the page markup without being escaped, resulting in potentially incorrect rendering. When I encountered this issue, it resulted in some docs and span underlines being superimposed on top of properly rendered docs and span underlines near the beginning of the visualization (due to an unescaped <span> tag).

Fixes #12816.

Types of change

Bug fix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed (except for a few errors related to a missing Vectors.attr field, but they don't seem related to my changes)
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

These changes add a missing call to `escape_html` in the displaCy span
renderer. Previously span-annotated tokens would be inserted into the
page markup without being escaped, resulting in potentially incorrect
rendering. When I encountered this issue, it resulted in some docs and
span underlines being superimposed on top of properly rendered docs and
span underlines near the beginning of the visualization (due to an
unescaped `<span>` tag).
@svlandeg svlandeg added bug Bugs and behaviour differing from documentation feat / visualizers Feature: Built-in displaCy and other visualizers labels Jul 13, 2023
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the report and the PR! We appreciate it 🙏

@svlandeg svlandeg merged commit 0566c3a into explosion:master Jul 13, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation feat / visualizers Feature: Built-in displaCy and other visualizers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Annotated HTML tags are not escaped in displaCy span renderer output
2 participants