Fix warnings on HTML elements in placeholders - #4529
Merged
Merged
Conversation
In the last commit in the mozilla#4525, I oversimplified the code on a wrong assumption > ▎ "The parser can't produce <a href="{$arg1 :string @source=|%1$s|}"> — <a href="%1$s">policy</a> is parsed as {#a href=|%1$s|}policy{/a}" That's only true for raw, unescaped XML elements, not for escaped HTML (`<a href="%1$s">…</a>`), which is the case for markup in Android strings.xml. Updating tests and adding in the docstring what's the textual representation of the string, since it only shows up as MF2 in the code. Fixes mozilla#4524
mathjazz
reviewed
Sep 15, 2026
mathjazz
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. See one comment inline.
Just started deployment to DEV.
Comment on lines
+320
to
+322
| rest = pat_src[pm.start() :] | ||
| for ph in src_ph_strings: | ||
| if pat_src.startswith(ph, pm.start()): | ||
| if rest.startswith(ph): |
Collaborator
There was a problem hiding this comment.
What is the purpose of this change? The logic is the same, it's more code and less efficient.
Collaborator
Author
There was a problem hiding this comment.
That's a mistake. I reverted the commit, and forgot to keep the optimization.
mathjazz
approved these changes
Sep 15, 2026
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.
In the last commit of #4525, I oversimplified the code on a wrong assumption after testing that everything was working
That's only true for raw, unescaped XML elements, not for escaped HTML (
<a href="%1$s">…</a>), which is the case for markup in Android strings.xml files.Updating tests and adding in the docstring what's the textual representation of the string, since it only shows up as MF2 in the code.
Fixes #4524.
Tested locally and the string is submitted without errors or warnings.