Skip to content

Commit 566063d

Browse files
authoredJan 3, 2024
feat(html/parser): Allow self-closing /> on non-void HTML elements via a flag (#8460)
1 parent f2ede40 commit 566063d

File tree

3 files changed

+268
-108
lines changed

3 files changed

+268
-108
lines changed
 

‎crates/swc_html_codegen/tests/fixture.rs

+1
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ fn html5lib_tests_verify(input: PathBuf) {
638638
let parser_config = ParserConfig {
639639
scripting_enabled,
640640
iframe_srcdoc: false,
641+
allow_self_closing: false,
641642
};
642643
let codegen_config = CodegenConfig {
643644
minify: false,

‎crates/swc_html_parser/src/parser/mod.rs

+266-108
Large diffs are not rendered by default.

‎crates/swc_html_parser/tests/html5lib_tests.rs

+1
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ fn html5lib_test_tree_construction(input: PathBuf) {
721721
let config = ParserConfig {
722722
scripting_enabled,
723723
iframe_srcdoc: false,
724+
allow_self_closing: false,
724725
};
725726
let mut parser = Parser::new(lexer, config);
726727

0 commit comments

Comments
 (0)
Please sign in to comment.