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

Untransformed (but HTML-safe) tags in the kiwix-serve frontend #1121

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

veloman-yunkan
Copy link
Collaborator

Fixes #899

Also fixed the size/alignment of the tag filter indicator that was overlooked in #1009

- Tags in the OPDS feed are HTML encoded and must be decoded.

- Tag values must be HTML encoded when injected into the DOM:

  * When the injection is done by setting the innerHTML attribute of a
    DOM element, HTML encoding must be done explicitly (since that text
    is going to be parsed as HTML).

  * When the tag value is expanded into a string that is then set as an
    attribute of a DOM element via the setAttribute() method, no HTML
    encoding must be done (since Element.setAttribute() directly sets
    that value and no HTML decoding is involved in that operation).
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Not tested but LGTM ; thank you

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.44%. Comparing base (196185d) to head (2b8a071).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1121   +/-   ##
=======================================
  Coverage   41.44%   41.44%           
=======================================
  Files          59       59           
  Lines        4244     4244           
  Branches     2322     2322           
=======================================
  Hits         1759     1759           
+ Misses        993      990    -3     
- Partials     1492     1495    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kelson42 kelson42 merged commit 801b1df into main Sep 5, 2024
17 checks passed
@kelson42 kelson42 deleted the safe_tags_without_makeup branch September 5, 2024 04:43
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.

Why are tags transformed?
3 participants