File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,14 @@ impl IgnoreBlocks {
3333 }
3434 }
3535 }
36+ } else if let Event :: Start ( Tag :: HtmlBlock ) = event {
37+ let start = range. start ;
38+ while let Some ( ( event, range) ) = parser. next ( ) {
39+ if let Event :: End ( TagEnd :: HtmlBlock ) = event {
40+ ignore. push ( start..range. end ) ;
41+ break ;
42+ }
43+ }
3644 } else if let Event :: InlineHtml ( _) = event {
3745 ignore. push ( range) ;
3846 } else if let Event :: Code ( _) = event {
@@ -253,3 +261,24 @@ fn cbs_11() {
253261 ] ,
254262 ) ;
255263}
264+
265+ #[ test]
266+ fn cbs_12 ( ) {
267+ assert_eq ! (
268+ bodies(
269+ "
270+ Test
271+
272+ <!-- Test -->
273+ <!--
274+ This is an HTML comment.
275+ -->
276+ "
277+ ) ,
278+ [
279+ Ignore :: No ( "\n Test\n \n " ) ,
280+ Ignore :: Yes ( "<!-- Test -->\n " ) ,
281+ Ignore :: Yes ( "<!--\n This is an HTML comment.\n -->\n " )
282+ ] ,
283+ ) ;
284+ }
You can’t perform that action at this time.
0 commit comments