-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Most XML entities not being decoded by reader #99
Comments
I'll take a look at const str = `<ssid>Me & Myself's WiFi ©𝌆</ssid>`;
const p = new DOMParser();
const s = new XMLSerializer();
s.serializeToString(p.parseFromString(str, "application/xml")); <ssid>
<parsererror xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black\">
<h3>This page contains the following errors:</h3>
<div style=\"font-family:monospace;font-size:12px\">
error on line 1 at column 41: Entity 'copy' not defined\n
</div>
<h3>Below is a rendering of the page up to the first error.</h3>
</parsererror>
</ssid> without const str = `<ssid>Me & Myself's WiFi 𝌆</ssid>`;
const p = new DOMParser();
const s = new XMLSerializer();
s.serializeToString(p.parseFromString(str, "application/xml")); <ssid>Me & Myself's WiFi 𝌆</ssid> |
Instead of throwing on unknown entities, I opted to silently ignore them. Your code should return: Me & Myself's WiFi ©𝌆 |
Thank you. My driving bug had to do with |
@oozcitak When might I expect the next release with this fix? |
Oh shoot sorry. Forgot to release. I'll prepare one tomorrow. Thanks for reminding. |
Released |
Tried it. Looked at the code. It looks like the code should encode/decode
|
I see that
Expected result: Actual result with v3.0.2: |
Describe the bug
New XML entity decoding in v3.0 only works on & < and >, but not others. Interestingly, the XML builder does encode a few other characters like '.
To Reproduce
The output string is
Me & Myself's WiFi &copy;&#x1D306;
The first two entities were not touched, while the last two got double-encoded.
Expected behavior
Expected result to be
Me & Myself's WiFi ©𝌆
.Version:
Additional context
Related to #88
The text was updated successfully, but these errors were encountered: