@@ -29,6 +29,9 @@ use crate::html::highlight;
29
29
use crate :: html:: layout:: Page ;
30
30
use crate :: html:: markdown:: MarkdownSummaryLine ;
31
31
32
+ const ITEM_TABLE_OPEN : & ' static str = "<div class=\" item-table\" >" ;
33
+ const ITEM_TABLE_CLOSE : & ' static str = "</div>" ;
34
+
32
35
pub ( super ) fn print_item ( cx : & Context < ' _ > , item : & clean:: Item , buf : & mut Buffer , page : & Page < ' _ > ) {
33
36
debug_assert ! ( !item. is_stripped( ) ) ;
34
37
// Write the breadcrumb trail header for the top
@@ -263,14 +266,15 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
263
266
curty = myty;
264
267
} else if myty != curty {
265
268
if curty. is_some ( ) {
266
- w. write_str ( "</item-table>" ) ;
269
+ w. write_str ( ITEM_TABLE_CLOSE ) ;
267
270
}
268
271
curty = myty;
269
272
let ( short, name) = item_ty_to_strs ( myty. unwrap ( ) ) ;
270
273
write ! (
271
274
w,
272
275
"<h2 id=\" {id}\" class=\" section-header\" >\
273
- <a href=\" #{id}\" >{name}</a></h2>\n <item-table>",
276
+ <a href=\" #{id}\" >{name}</a></h2>\n {}",
277
+ ITEM_TABLE_OPEN ,
274
278
id = cx. derive_id( short. to_owned( ) ) ,
275
279
name = name
276
280
) ;
@@ -283,14 +287,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
283
287
match * src {
284
288
Some ( ref src) => write ! (
285
289
w,
286
- "<item-left><code>{}extern crate {} as {};" ,
290
+ "<div class= \" item-left\" ><code>{}extern crate {} as {};" ,
287
291
myitem. visibility. print_with_space( myitem. def_id, cx) ,
288
292
anchor( myitem. def_id. expect_real( ) , & * src. as_str( ) , cx) ,
289
293
myitem. name. as_ref( ) . unwrap( ) ,
290
294
) ,
291
295
None => write ! (
292
296
w,
293
- "<item-left><code>{}extern crate {};" ,
297
+ "<div class= \" item-left\" ><code>{}extern crate {};" ,
294
298
myitem. visibility. print_with_space( myitem. def_id, cx) ,
295
299
anchor(
296
300
myitem. def_id. expect_real( ) ,
@@ -299,7 +303,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
299
303
) ,
300
304
) ,
301
305
}
302
- w. write_str ( "</code></item-left> \n " ) ;
306
+ w. write_str ( "</code></div> " ) ;
303
307
}
304
308
305
309
clean:: ImportItem ( ref import) => {
@@ -326,10 +330,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
326
330
327
331
write ! (
328
332
w,
329
- "<item-left class=\" {stab}{add}import-item\" >\
333
+ "<div class=\" item-left {stab}{add}import-item\" >\
330
334
<code>{vis}{imp}</code>\
331
- </item-left >\
332
- <item-right class=\" docblock-short\" >{stab_tags}</item-right >",
335
+ </div >\
336
+ <div class=\" item-right docblock-short\" >{stab_tags}</div >",
333
337
stab = stab. unwrap_or_default( ) ,
334
338
add = add,
335
339
vis = myitem. visibility. print_with_space( myitem. def_id, cx) ,
@@ -358,10 +362,11 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
358
362
let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
359
363
write ! (
360
364
w,
361
- "<item-left class=\" {stab}{add}module-item\" >\
365
+ "<div class=\" item-left {stab}{add}module-item\" >\
362
366
<a class=\" {class}\" href=\" {href}\" \
363
- title=\" {title}\" >{name}</a>{unsafety_flag}</item-left>\
364
- <item-right class=\" docblock-short\" >{stab_tags}{docs}</item-right>",
367
+ title=\" {title}\" >{name}</a>{unsafety_flag}\
368
+ </div>\
369
+ <div class=\" item-right docblock-short\" >{stab_tags}{docs}</div>",
365
370
name = * myitem. name. as_ref( ) . unwrap( ) ,
366
371
stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
367
372
docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
@@ -381,7 +386,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
381
386
}
382
387
383
388
if curty. is_some ( ) {
384
- w. write_str ( "</item-table>" ) ;
389
+ w. write_str ( ITEM_TABLE_CLOSE ) ;
385
390
}
386
391
}
387
392
0 commit comments