Fix Cell Objects to always have html-encoded data for "h" key #629
No reviewers
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#629
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some cases left characters like
&
and<
unencoded in the "h" key, making it unreliable for direct embedding in html.What should happen with other entities? Here's a fun test case we threw together for testing entities in plaintext formats:
CODES.xlsx
Excel's XML uses a special form
_xHHHH_
for encoding other entities, as demonstrated in B2 in Sheet1 from the attached workbook:Squashed the two commits and added a few tests in
616d2e534f
The open question is whether more HTML entities should be supported. For example, take the unicode BLACK HEART SUIT ♥ There are two acceptable HTML encodings:
♥
<html>♥</html>♥
<html>♥</html>@SheetJSDev Thanks for adding tests!
If we are only talking about encoding html, here's my opinion:
I don't think it makes sense to encode more entities than is strictly necessary. Other tools outside xlsx can be used if more encoding is needed. I think entities were more popular when people didn't use UTF-8 but some other charset. Special Excel XML entities like xHHHH should be decoded before encoding to HTML.
Thanks!
@xkr47 there are some more corner cases to work out, but that's for another day. 0.9.11 also integrates an HTML writer that properly handles merge cells as rowspan/colspan.
Even though the PR shows up as "closed" rather than "merged", you are marked as the author of commit
616d2e5
Ok, cool!
Yeah I noticed, 👍
Pull request closed