Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include trimming of former collapse_whitespace in docs #90

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

funkyfuture
Copy link
Contributor

as the promise of pretty serialization will be that its introduced whitespace would vanish when parsing (with the proper option set), i thought it'd be better to clarify how that inverse operates. beyond the slight rewording i opted for another method / option name. explicitly including trim would yield rather long names.

I considered the alternative name `collapse_and_trim_whitespace` as too long.

Too specific debugging testing was removed from the test to this
routine and it was extended with a case that shows a maybe unexpected but
proper behaviour.
@funkyfuture funkyfuture added the design Proposals and discussion of API changes label May 19, 2024
@funkyfuture funkyfuture added this to the 0.5 milestone May 19, 2024
JKatzwinkel
JKatzwinkel previously approved these changes May 19, 2024
It also fixes the edge-case of empty TextNodes.
Both, filter and cache lock, are now consistently enabled once.
When used only on a subtree, it is also ensured the DOM has no neighbouring
text nodes as the trimming assumes that.
Optimizations are applied as well.
@funkyfuture
Copy link
Contributor Author

sorry, i still realised what was really nagging me there. the last commit is something else but similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Proposals and discussion of API changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants