Skip to content

Find a content-language meta that is not the first meta - #357

Merged
benoit74 merged 1 commit into
openzim:mainfrom
Sarthak-Shreshtha01:fix/language-from-any-meta
Oct 19, 2026
Merged

benoit74 merged 1 commit into
openzim:mainfrom
Sarthak-Shreshtha01:fix/language-from-any-meta

Conversation

@Sarthak-Shreshtha01

Copy link
Copy Markdown
Contributor

Fixes #356

find_language_in only looked at the first <html>, <body> and <meta> tag, so a content-language <meta> was missed whenever another <meta> (usually <meta charset>) came before it. It now checks every matching tag, in the same order as before.

Added a case with <meta charset> before the content-language <meta> to test_find_language_order; it fails before the change and passes after it. Ruff passes; the rest of the test suite has the same results as main (locally only the GIF tests fail, as gifsicle is not installed).

Copilot AI balanced review requested due to automatic review settings October 19, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@benoit74 benoit74 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, nice catch and fix

Fixes openzim#356

Signed-off-by: Sarthak <sarthakshreshtha345@gmail.com>
@benoit74
benoit74 force-pushed the fix/language-from-any-meta branch from b04be56 to d7b7c14 Compare October 19, 2026 13:02
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4ec8322) to head (d7b7c14).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #357   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         2799      2798    -1     
  Branches       417       417           
=========================================
- Hits          2799      2798    -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74
benoit74 merged commit 6613ac5 into openzim:main Oct 19, 2026
10 checks passed
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.

find_language_in misses a content-language meta that is not the first meta

3 participants