Skip to content

Conversation

@walmon
Copy link

@walmon walmon commented Oct 11, 2022

Depending on the build setup whitespaces will potentially be turned into #text nodes, so when querying for the first child node as the current code does it breaks the plugin. Instead, it should ignore #text nodes and pick the node that the user actually intended to be used.

This change should not break setups where whitespaces are not kept and therefore turned into #text nodes as if there's a single node, then the system will take that instance anyway (same as it used to do with firstChild.

See mdn reference.

Depending on the build setup whitespaces potentially return a `#text` when querying for the first child node, instead, the system must ignore them and pick the node that the user intended to be used.
@walmon walmon changed the title deal with empty nodes Deal with #text nodes from whitespaces Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant