tree-sitter-html icon indicating copy to clipboard operation
tree-sitter-html copied to clipboard

add leading and trailing whitespace to text nodes

Open milahu opened this issue 1 year ago • 2 comments

fix #87

milahu avatar Mar 05 '24 10:03 milahu

should the first newline even be considered? what about text: _ => /[^<>&\n][^<>&]*/?

amaanq avatar May 04 '24 07:05 amaanq

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 &gt;" which would be a bit wasteful

milahu avatar May 04 '24 08:05 milahu