@@ -29,6 +29,9 @@ use crate::html::highlight;
2929use crate :: html:: layout:: Page ;
3030use crate :: html:: markdown:: MarkdownSummaryLine ;
3131
32+ const ITEM_TABLE_OPEN : & ' static str = "<div class=\" item-table\" >" ;
33+ const ITEM_TABLE_CLOSE : & ' static str = "</div>" ;
34+
3235pub ( super ) fn print_item ( cx : & Context < ' _ > , item : & clean:: Item , buf : & mut Buffer , page : & Page < ' _ > ) {
3336 debug_assert ! ( !item. is_stripped( ) ) ;
3437 // 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
263266 curty = myty;
264267 } else if myty != curty {
265268 if curty. is_some ( ) {
266- w. write_str ( "</item-table>" ) ;
269+ w. write_str ( ITEM_TABLE_CLOSE ) ;
267270 }
268271 curty = myty;
269272 let ( short, name) = item_ty_to_strs ( myty. unwrap ( ) ) ;
270273 write ! (
271274 w,
272275 "<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 ,
274278 id = cx. derive_id( short. to_owned( ) ) ,
275279 name = name
276280 ) ;
@@ -283,14 +287,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
283287 match * src {
284288 Some ( ref src) => write ! (
285289 w,
286- "<item-left><code>{}extern crate {} as {};" ,
290+ "<div class= \" item-left\" ><code>{}extern crate {} as {};" ,
287291 myitem. visibility. print_with_space( myitem. def_id, cx) ,
288292 anchor( myitem. def_id. expect_real( ) , & * src. as_str( ) , cx) ,
289293 myitem. name. as_ref( ) . unwrap( ) ,
290294 ) ,
291295 None => write ! (
292296 w,
293- "<item-left><code>{}extern crate {};" ,
297+ "<div class= \" item-left\" ><code>{}extern crate {};" ,
294298 myitem. visibility. print_with_space( myitem. def_id, cx) ,
295299 anchor(
296300 myitem. def_id. expect_real( ) ,
@@ -299,7 +303,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
299303 ) ,
300304 ) ,
301305 }
302- w. write_str ( "</code></item-left> \n " ) ;
306+ w. write_str ( "</code></div> " ) ;
303307 }
304308
305309 clean:: ImportItem ( ref import) => {
@@ -326,10 +330,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
326330
327331 write ! (
328332 w,
329- "<item-left class=\" {stab}{add}import-item\" >\
333+ "<div class=\" item-left {stab}{add}import-item\" >\
330334 <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 >",
333337 stab = stab. unwrap_or_default( ) ,
334338 add = add,
335339 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
358362 let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
359363 write ! (
360364 w,
361- "<item-left class=\" {stab}{add}module-item\" >\
365+ "<div class=\" item-left {stab}{add}module-item\" >\
362366 <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>",
365370 name = * myitem. name. as_ref( ) . unwrap( ) ,
366371 stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
367372 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
381386 }
382387
383388 if curty. is_some ( ) {
384- w. write_str ( "</item-table>" ) ;
389+ w. write_str ( ITEM_TABLE_CLOSE ) ;
385390 }
386391}
387392
0 commit comments