all repos — htmlformat @ 314e0256b2b643fbd8acbea6c722fceecc102050

Go package and CLI tool used to format HTML

feat: skip formatting scripts (#3) * feat: skip formatting scripts * chore: fix up after PR

Adrian Hesketh
commit

314e0256b2b643fbd8acbea6c722fceecc102050

parent

1244374b2562d411222e82377bf11c1b84ea532d

1 file changed, 9 insertions(+), 0 deletions(-)

changed files
M format_test.goformat_test.go
@@ -53,6 +53,15 @@ input: `test 123`,
expected: `test 123` + "\n", }, { + name: "script tags are not formatted", + input: `<script> + var x = 1; +</script>`, + expected: `<script> + var x = 1; +</script>` + "\n", + }, + { name: "phrasing content element children are kept on the same line, including punctuation", input: `<ul><li><a href="http://example.com">Test</a>.</li></ul>`, expected: `<ul>