You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I can have the parser create a text node on tags without attributes by setting alwaysCreateTextNode: true. However, for self closing tags, I would like the parser to not create a text node. Right now it creates a text node set to an empty string.
I also noticed that if a self closing tags have any attributes, a text node is not created. It only seems like it's created when a self closing tags have no attributes.
I expect that "#text" is always present, no matter if the self closing tag have attributes or not. But my primary expectation is to be able to have no text nodes at all for self closing tags while still allowing the parser to make text nodes for tags without any attributes.
The text was updated successfully, but these errors were encountered:
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.
hornta
changed the title
Can I create a text node if the tag is not self closing?
Creating text nodes for tags without any attributes.
Feb 13, 2025
hornta
changed the title
Creating text nodes for tags without any attributes.
Don't create text node for self closing tags when alwaysCreateTextNode: trueFeb 13, 2025
Currently I can have the parser create a text node on tags without attributes by setting
alwaysCreateTextNode: true
. However, for self closing tags, I would like the parser to not create a text node. Right now it creates a text node set to an empty string.I also noticed that if a self closing tags have any attributes, a text node is not created. It only seems like it's created when a self closing tags have no attributes.
I expect that
"#text"
is always present, no matter if the self closing tag have attributes or not. But my primary expectation is to be able to have no text nodes at all for self closing tags while still allowing the parser to make text nodes for tags without any attributes.The text was updated successfully, but these errors were encountered: