@@ -1109,19 +1109,27 @@ fn test_markdown_heading_anchor_set() {
11091109// Superscript/subscript tests
11101110
11111111fn test_markdown_superscript () {
1112- rt := markdown_to_rich_text ('E=mc^2^' , MarkdownStyle{})
1112+ style := MarkdownStyle{}
1113+ rt := markdown_to_rich_text ('E=mc^2^' , style)
11131114 sup_runs := rt.runs.filter (it .text == '2' )
11141115 assert sup_runs.len > = 1
1115- // OpenType 'sups' feature handles sizing
1116+ assert sup_runs[0 ].style.size < style.text.size
1117+ assert sup_runs[0 ].style.rise > 0
11161118 assert sup_runs[0 ].style.features != unsafe { nil }
1119+ assert sup_runs[0 ].style.features.opentype_features.len == 1
1120+ assert sup_runs[0 ].style.features.opentype_features[0 ].tag == 'sups'
11171121}
11181122
11191123fn test_markdown_subscript () {
1120- rt := markdown_to_rich_text ('H~2~O' , MarkdownStyle{})
1124+ style := MarkdownStyle{}
1125+ rt := markdown_to_rich_text ('H~2~O' , style)
11211126 sub_runs := rt.runs.filter (it .text == '2' )
11221127 assert sub_runs.len > = 1
1123- // OpenType 'subs' feature handles sizing
1128+ assert sub_runs[0 ].style.size < style.text.size
1129+ assert sub_runs[0 ].style.rise < 0
11241130 assert sub_runs[0 ].style.features != unsafe { nil }
1131+ assert sub_runs[0 ].style.features.opentype_features.len == 1
1132+ assert sub_runs[0 ].style.features.opentype_features[0 ].tag == 'subs'
11251133}
11261134
11271135fn test_markdown_subscript_vs_strikethrough () {
0 commit comments