Skip to content

fix: resolve double-encoded HTML entities in title and description - #456

Open
Zerthick wants to merge 1 commit into
Guts:mainfrom
Zerthick:fix/double-encoded-html-entities
Open

fix: resolve double-encoded HTML entities in title and description#456
Zerthick wants to merge 1 commit into
Guts:mainfrom
Zerthick:fix/double-encoded-html-entities

Conversation

@Zerthick

Copy link
Copy Markdown

Description

Resolve double-encoded HTML entities (e.g. &, <, >) in RSS feed title and description fields.

MkDocs pre-escapes content, and then Jinja's |e filter escapes again, producing double-encoded entities. Using html.unescape() in Python before template rendering ensures |e performs a single correct escape.

Changes

  • Add html_module.unescape() for title and description in plugin.py
  • Add test fixture with special characters (& < >)
  • Add test verifying no double-encoded entities in output

Split from: #451


💡 AI Contribution Level: 8 — Based on the VisiData AI contribution scale, this was an AI-assisted contribution where the AI performed the code splitting and PR creation with minimal human guidance.

MkDocs pre-escapes content, then Jinja's |e filter escapes again,
producing &amp;amp;, &amp;lt;, &amp;gt;. Use html.unescape() in Python
before template rendering so |e performs a single correct escape.

- Add html_module.unescape() for title and description in plugin.py
- Add test fixture with special characters
- Add test verifying no double-encoded entities
@github-actions github-actions Bot added bug Something isn't working quality Tests, project resiliency, etc. labels Aug 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.18%. Comparing base (1b5e630) to head (ada0a8d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #456      +/-   ##
==========================================
+ Coverage   83.16%   83.18%   +0.02%     
==========================================
  Files          11       11              
  Lines         784      785       +1     
  Branches      133      133              
==========================================
+ Hits          652      653       +1     
  Misses         86       86              
  Partials       46       46              
Flag Coverage Δ
unittests 83.18% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
mkdocs_rss_plugin/plugin.py 89.50% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quality Tests, project resiliency, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant