@@ -371,16 +371,21 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
371
371
}
372
372
clean:: ImportKind :: Glob => String :: new ( ) ,
373
373
} ;
374
+ let stab_tags = stab_tags. unwrap_or_default ( ) ;
375
+ let ( stab_tags_before, stab_tags_after) = if stab_tags. is_empty ( ) {
376
+ ( "" , "" )
377
+ } else {
378
+ ( "<div class=\" item-right docblock-short\" >" , "</div>" )
379
+ } ;
374
380
write ! (
375
381
w,
376
382
"<div class=\" item-left {stab}{add}import-item\" {id}>\
377
383
<code>{vis}{imp}</code>\
378
384
</div>\
379
- <div class= \" item-right docblock-short \" >{ stab_tags}</div> ",
385
+ {stab_tags_before}{ stab_tags}{stab_tags_after} ",
380
386
stab = stab. unwrap_or_default( ) ,
381
387
vis = myitem. visibility. print_with_space( myitem. item_id, cx) ,
382
388
imp = import. print( cx) ,
383
- stab_tags = stab_tags. unwrap_or_default( ) ,
384
389
) ;
385
390
w. write_str ( ITEM_TABLE_ROW_CLOSE ) ;
386
391
}
@@ -412,6 +417,12 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
412
417
413
418
let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
414
419
w. write_str ( ITEM_TABLE_ROW_OPEN ) ;
420
+ let docs = MarkdownSummaryLine ( & doc_value, & myitem. links ( cx) ) . into_string ( ) ;
421
+ let ( docs_before, docs_after) = if docs. is_empty ( ) {
422
+ ( "" , "" )
423
+ } else {
424
+ ( "<div class=\" item-right docblock-short\" >" , "</div>" )
425
+ } ;
415
426
write ! (
416
427
w,
417
428
"<div class=\" item-left {stab}{add}module-item\" >\
@@ -420,11 +431,10 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
420
431
{unsafety_flag}\
421
432
{stab_tags}\
422
433
</div>\
423
- <div class= \" item-right docblock-short \" >{ docs}</div> ",
434
+ {docs_before}{ docs}{docs_after} ",
424
435
name = myitem. name. unwrap( ) ,
425
436
visibility_emoji = visibility_emoji,
426
437
stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
427
- docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
428
438
class = myitem. type_( ) ,
429
439
add = add,
430
440
stab = stab. unwrap_or_default( ) ,
@@ -987,7 +997,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
987
997
// So C's HTML will have something like this:
988
998
//
989
999
// ```html
990
- // <script type="text/javascript" src="/implementors/A/trait.Foo.js"
1000
+ // <script src="/implementors/A/trait.Foo.js"
991
1001
// data-ignore-extern-crates="A,B" async></script>
992
1002
// ```
993
1003
//
@@ -1013,9 +1023,11 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
1013
1023
. map ( |cnum| cx. shared . tcx . crate_name ( cnum) . to_string ( ) )
1014
1024
. collect :: < Vec < _ > > ( )
1015
1025
. join ( "," ) ;
1026
+ let ( extern_before, extern_after) =
1027
+ if extern_crates. is_empty ( ) { ( "" , "" ) } else { ( " data-ignore-extern-crates=\" " , "\" " ) } ;
1016
1028
write ! (
1017
1029
w,
1018
- "<script type= \" text/javascript \" src=\" {src}\" data-ignore-extern-crates= \" { extern_crates}\" async></script>" ,
1030
+ "<script src=\" {src}\" {extern_before}{ extern_crates}{extern_after} async></script>" ,
1019
1031
src = js_src_path. finish( ) ,
1020
1032
) ;
1021
1033
}
0 commit comments