diff --git a/src/grammar/html.pest b/src/grammar/html.pest index d8f4f16d..67e55c41 100644 --- a/src/grammar/html.pest +++ b/src/grammar/html.pest @@ -22,7 +22,7 @@ doctype_name = @{ ^"doctype" } // NODES // node = _{ comment | node_element | text } -comment = _{ comment_if | comment_normal } +comment = { comment_if | comment_normal } text = { (!(chevron_left_normal | comment_tag_start ) ~ ANY)+ } // NOTE: Should we be able to write < in text? ^^ node_element = { el_void | el_void_xml | el_process_instruct | javascript_text | style_text | el_raw_text | el_normal | el_dangling } diff --git a/src/html.rs b/src/html.rs index b0b431ad..9a023342 100644 --- a/src/html.rs +++ b/src/html.rs @@ -50,6 +50,7 @@ mod tests { fn test_format_html() { let html = r###" + <%= title %>或者{{ title }}
@@ -86,6 +87,7 @@ mod tests { let expected = r###" + <%= title %>或者{{ title }}