tree-sitter-html
tree-sitter-html copied to clipboard
add leading and trailing whitespace to text nodes
fix #87
should the first newline even be considered? what about text: _ => /[^<>&\n][^<>&]*/?
yes, the parser should be lossless everything outside of tags should be parsed as text
the text regex could be even more greedy like /[^<&]+/ to allow > in text
but i cant remember if i tested that
maybe > is already parsed as "unescaped entity >" which would be a bit wasteful