Repository navigation
Conversation
Keep greater-than characters inside quoted attribute values in the opening tag instead of treating them as a tag boundary. Co-authored-by: generaltony007 <[email protected]>
Cover single and double quotes, mixed quotes, nested tags, self-closing and incomplete tags, comments, and CDATA without changing their handling. Co-authored-by: generaltony007 <[email protected]>
|
Could you review this quoted-attribute delimiter fix when you have time? It preserves greater-than characters inside quoted XML/HTML attributes while retaining comment, CDATA and incomplete-markup handling. The current test, lint, type, coverage and build checks passed; deployment jobs are skipped. Please let me know if any changes are needed before this can be considered for merge. Thanks. |
|
A queue question, grouped here rather than posting the same follow-up on all nine PRs: are these fixes still in scope for review, or are there any you would prefer me to close? Besides this XML/HTML delimiter fix, the open changes are #8522, #8523, #8525, #8529, #8531, #8533, #8534 and #8535. If you prefer one at a time, which should take priority? If an approach is unwanted or has been superseded, I can close that PR rather than leave it in your queue. I am checking the stale merge/CI blockers separately. This is not a claim that all nine are currently merge-ready. |
|
Could a maintainer advise whether this XML/HTML quoted-attribute fix is still wanted and what the next step is for human review? Please let me know if you need changes or would prefer this PR closed. I'm not treating the earlier local validation as a claim that the current PR is merge-ready. Thanks. |
Description
The XML/HTML content view currently treats every
>as the end of an opening tag, including delimiters inside quoted attribute values. For example:is formatted as
<p title="1 >0">text</p>, changing the attribute value. Nested elements can also acquire indentation and newlines inside their attributes.Track single/double quote state while scanning ordinary tags so only an unquoted
>closes the tag. Keep the existing comment and CDATA handling, and preserve incomplete markup without raising an error. This remains a linear scan and does not introduce an XML parser dependency.Tests
_view_xml_html.py(171 statements).uv run tox -e lint, mypy (288 source files), and filename matching: passed.uv run pytest test/mitmproxy/ -q: 2014 passed, 2 skipped, 1 failure because this environment cannot create a TUN device. The sametest_tun_modefailure reproduces on unchanged main. Re-running with that test deselected: 2013 passed, 2 skipped, 2 deselected.Tested with the frozen dependency lock on Python 3.14.8.