@@ -519,6 +519,54 @@ void main() {
519
519
content: plainContent ('<p><strong>bold</strong></p>' ),
520
520
styleFinder: findWordBold,
521
521
);
522
+
523
+ for (final level in HeadingLevel .values) {
524
+ final name = level.name;
525
+ assert (RegExp (r'^h[1-6]$' ).hasMatch (name));
526
+ testFontWeight ('in $name ' ,
527
+ expectedWght: 800 ,
528
+ // # **bold**, ## **bold**, ### **bold**, etc.
529
+ content: plainContent ('<$name ><strong>bold</strong></$name >' ),
530
+ styleFinder: findWordBold,
531
+ );
532
+ }
533
+
534
+ testFontWeight ('in different kind of span in h1' ,
535
+ expectedWght: 800 ,
536
+ // # ~~**bold**~~
537
+ content: plainContent ('<h1><del><strong>bold</strong></del></h1>' ),
538
+ styleFinder: findWordBold,
539
+ );
540
+
541
+ testFontWeight ('in spoiler header' ,
542
+ expectedWght: 900 ,
543
+ // ```spoiler regular **bold**
544
+ // content
545
+ // ```
546
+ content: plainContent (
547
+ '<div class="spoiler-block"><div class="spoiler-header">\n '
548
+ '<p>regular <strong>bold</strong></p>\n '
549
+ '</div><div class="spoiler-content" aria-hidden="true">\n '
550
+ '<p>content</p>\n '
551
+ '</div></div>'
552
+ ),
553
+ styleFinder: findWordBold,
554
+ );
555
+
556
+ testFontWeight ('in different kind of span in spoiler header' ,
557
+ expectedWght: 900 ,
558
+ // ```spoiler *italic **bold***
559
+ // content
560
+ // ```
561
+ content: plainContent (
562
+ '<div class="spoiler-block"><div class="spoiler-header">\n '
563
+ '<p><em>italic <strong>bold</strong></em></p>\n '
564
+ '</div><div class="spoiler-content" aria-hidden="true">\n '
565
+ '<p>content</p>\n '
566
+ '</div></div>'
567
+ ),
568
+ styleFinder: findWordBold,
569
+ );
522
570
});
523
571
524
572
testContentSmoke (ContentExample .emphasis);
0 commit comments