Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/html_parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ let parse requested_context report (tokens, set_tokenizer_state, set_foreign) =

(* 8.2.5.4.18. *)
and in_template_mode () =
dispatch tokens (fun v -> in_table_mode_rules in_template_mode v)
dispatch tokens (fun v -> in_template_mode_rules in_template_mode v)

(* 8.2.5.4.18. *)
and in_template_mode_rules mode = function
Expand Down
13 changes: 12 additions & 1 deletion test/test_html_parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1524,5 +1524,16 @@ let tests = [
1, 14, S (start_element "frame");
1, 14, S `End_element;
1, 21, S `End_element;
1, 32, S `End_element])
1, 32, S `End_element]);

("html.parser.template" >:: fun _ ->
expect ~context:None "<template></template>"
[ 1, 1, S (start_element "template");
1, 11, S `End_element];

expect ~context:None "<template><p></p></template>"
[ 1, 1, S (start_element "template");
1, 11, S (start_element "p");
1, 14, S `End_element;
1, 18, S `End_element]);
]