Repository navigation
Conversation
Signed-off-by: Ooi Pin Jun <pinjun15@gmail.com>
Contributor
|
✅ DCO Check Passed Thanks @pinjun99, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
AI triage (advisory)Checked commit Warning The AI analysis did not finish. Only the deterministic checks are shown. Topic labels added: CI safety: not assessed. Possibly related pull requests
The |
3 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #5784
In the MediaWiki backend,
<gallery>is a parser extension tag, so its body reaches_render_tag()as plain text and every entry came out as a text line (File:A.jpg|Caption A File:B.jpg) with no picture.This change treats
galleryas a block tag and renders eachFile:/Image:line as if it were a[[File:...]]link, so gallery entries become pictures with the same captions a file link outside a gallery gets. Lines without a file namespace, with an empty filename, or that do not parse as a single link are skipped. The per-entry parsing uses the same tokenizer work budget as the rest of the document.Found while testing the MediaWiki backend with Codex; I reviewed the diff and ran the tests.
Checklist:
docs/usage/supported_formats.md)Review evidence:
File:A.jpg|Caption A File:B.jpgand0pictures.A linkandB.jpgin the test), and the Markdown export matches the same content written as[[File:...]]links.test_mediawiki_gallery_matches_file_links,test_mediawiki_gallery_skips_invalid_entries,test_gallery_entries_share_the_tokenizer_work_budget: 3 failed on main with only the test change, 3 passed with the fix.pytest tests/test_backend_mediawiki.py: 75 passed, 1 failed. The failure (test_mediawiki_cli_can_convert_a_directory, "No module named 'torch'") also fails on unmodified main on my machine, which has no torch installed.ruff checkandruff format --checkon the changed files: clean.make validate/ prek,ty, the full test suite.