@@ -288,7 +288,13 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
288
288
} ;
289
289
290
290
let added_classes = parse_result. added_classes ;
291
- let lines = original_text. lines ( ) . filter_map ( |l| map_line ( l) . for_html ( ) ) ;
291
+ let lines = original_text. lines ( ) . filter_map ( |l| {
292
+ if parse_result. no_hidden_lines {
293
+ Some ( Cow :: Borrowed ( l) )
294
+ } else {
295
+ map_line ( l) . for_html ( )
296
+ }
297
+ } ) ;
292
298
let text = lines. intersperse ( "\n " . into ( ) ) . collect :: < String > ( ) ;
293
299
294
300
compile_fail = parse_result. compile_fail ;
@@ -879,6 +885,7 @@ pub(crate) struct LangString {
879
885
pub ( crate ) edition : Option < Edition > ,
880
886
pub ( crate ) added_classes : Vec < String > ,
881
887
pub ( crate ) unknown : Vec < String > ,
888
+ pub ( crate ) no_hidden_lines : bool ,
882
889
}
883
890
884
891
#[ derive( Eq , PartialEq , Clone , Debug ) ]
@@ -1213,6 +1220,7 @@ impl Default for LangString {
1213
1220
edition : None ,
1214
1221
added_classes : Vec :: new ( ) ,
1215
1222
unknown : Vec :: new ( ) ,
1223
+ no_hidden_lines : false ,
1216
1224
}
1217
1225
}
1218
1226
}
@@ -1274,6 +1282,10 @@ impl LangString {
1274
1282
data. rust = true ;
1275
1283
seen_rust_tags = true ;
1276
1284
}
1285
+ LangStringToken :: LangToken ( "no_hidden_lines" ) => {
1286
+ data. no_hidden_lines = true ;
1287
+ seen_rust_tags = !seen_other_tags;
1288
+ }
1277
1289
LangStringToken :: LangToken ( "custom" ) => {
1278
1290
if custom_code_classes_in_docs {
1279
1291
seen_custom_tag = true ;
0 commit comments