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.
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 withfirstChild
.See mdn reference.