Conversation
…ents; add tests for nil handling in node hierarchy (#15)
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
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.
This pull request improves the handling of
nilvalues in node hierarchies within thedompalibrary, ensuring thatnilentries do not inadvertently remove or affect sibling nodes when converting node trees to HTML. It also adds comprehensive tests to verify this behavior.Nil handling improvements:
nodes-from-optinsrc/dompa/nodes.cljcto explicitly handlenilvalues, ensuring they do not propagate into node children lists.src/dompa/nodes.cljcto removenilchildren and ensure the children vector only contains valid nodes.nodes->html-fnto return the currenthtmlstring instead of an empty string for unmatched cases, preventing accidental removal of siblings when encounteringnil.Testing improvements:
nil-in-hierarchy-does-not-remove-siblings-testintest/dompa/nodes_test.cljcto verify thatnilvalues do not affect sibling elements or their HTML output in various scenarios.