Repository navigation
Apply strip_document to BeautifulSoup Tag roots - #285
Open
ryanduguid wants to merge 1 commit into
Open
ryanduguid wants to merge 1 commit into
ryanduguid wants to merge 1 commit into
Conversation
Reuse the document newline policy after normal Tag processing when document conversion is available, and document the cache and validation effects. Cover exclusions, callbacks, resolver history and tree identity.
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.
Summary
Apply
strip_documentto completed BeautifulSoup Tag conversion, addressing the boundary-newline asymmetry reported in #209. Reuse the existing newline-only policy after normal root processing when cached[document]conversion is available.The added finalisation does not invoke the resolved document callback. Normal tag dispatch and document callback ownership remain in place; the README describes the proposed Tag contract.
Evidence
After: All 156 tests pass on Linux Python 3.8.20 and Windows Python 3.14.8. Coverage includes exclusions, custom callbacks, cached
None, method aliases, significant whitespace and original tree relationships.tox,python -m build -nwsx .,mypy .andmypy --strict tests/types.pypass. Windows pytest, configured flake8 and README lint pass.Merge danger
Door: two-way. Blast radius: fragment consumers.
This proposes a compatibility change: Tag boundaries, including custom converter output, now follow
strip_document; an invalid mode raises after Tag processing when document conversion is available. The extra cached document lookup, includingNone, can change later document behaviour with stateful resolvers.strip_document=Nonepreserves boundary text but still performs that lookup. Maintainer acceptance of these semantics remains necessary.Unverified
The full dependency-floor suite cannot collect the existing
test_escaping.pywarning import on both the base and initial candidate. Other Python/Windows versions, macOS, alternative parsers, Windows packaging/types, independent execution of the verification producers, additional exception-precedence/custom-unavailable-invalid-mode probes, scanner parser coverage, hosted CI and downstream reliance remain unverified. No performance improvement is claimed.