lit-analyzer icon indicating copy to clipboard operation
lit-analyzer copied to clipboard

[lit-analyzer] Parse template strings with lit-html's parsing utility to correctly identify parts

Open justinfagnani opened this issue 2 years ago • 0 comments

lit-html 2.0 has a more sophisticated HTML tokenizer which allows us to correctly identify what syntactic position an expression is in and insert the appropriate marker so that the HTML parses correctly. This is necessary to support element expressions because we must insert a unique attribute name as the marker.

The easiest way to do this is to use the getTemplateHtml from lit-html itself, which we also use to parse templates in Lit's SSR package.

justinfagnani avatar Jul 09 '21 16:07 justinfagnani