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

[webdav] Escape HTML entities by number #2600

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

Conversation

CodingKoopa
Copy link

@CodingKoopa CodingKoopa commented Dec 1, 2021

This pull request addresses issue #2599 by escaping the HTML entities by number, rather than the shorthand identifiers that strict XML parsers don't understand.

To obtain the list, I:

  • Downloaded Blink's HTML entity list
  • Removed entries at the bottom by hand that had two codepoints.
  • Removed duplicate entries by replacing
^"(.+?)","U\+([0-9a-fA-F]{5})"\n"(.+?)","U\+(\2)"$

with

"$1","U+$2"`
  • Converted the list to the source code format by replacing
^"(.+)?","U\+([0-9a-fA-F]{5})"$

with

        escapesec[$2] = "&#x$2;"; // $1

#2596 also fixes the aforementioned issue, which I admittedly didn't notice until submitting this PR. I believe they are sufficiently different approaches to the problem though.

This approach pollutes utils.cpp considerably, it may be better to split this off into a separate file.

Thanks!

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.

None yet

1 participant