lukeed/tidyPublic

feat: script module flag

The embed request now says whether JavaScript is a module or a
classic script, as Prettier's __babelSourceType does: a <script> in
HTML is a classic script unless its type makes it a module. Legacy
<!-- --> comments only parse in a classic script.

A </script in the host's answer would end the element early, so it
is escaped as <\/script, which Prettier also prints in the one place
where one can come out.
LELuke Edwards authored
a3b4d64Patch
Parent53d186d
7 files changed+111-16
StackedSplit
crates/tidyrs/src/css/mod.rs+1 โˆ’0
crates/tidyrs/src/embed.rs+3 โˆ’0
crates/tidyrs/src/handlebars/printer.rs+3 โˆ’0
crates/tidyrs/src/html/embed.rs+80 โˆ’14
crates/tidyrs/src/xml/print.rs+8 โˆ’2
crates/tidyrs/tests/html.rs+13 โˆ’0
crates/tidyrs_napi/src/lib.rs+3 โˆ’0