@@ -558,7 +558,11 @@ void main() {
558
558
group ('MathBlock' , () {
559
559
testContentSmoke (ContentExample .mathBlock);
560
560
561
- testWidgets ('displays KaTeX source; experimental flag default' , (tester) async {
561
+ testWidgets ('displays KaTeX source; experimental flag disabled' , (tester) async {
562
+ addTearDown (testBinding.reset);
563
+ final globalSettings = testBinding.globalStore.settings;
564
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
565
+
562
566
await prepareContent (tester, plainContent (ContentExample .mathBlock.html));
563
567
tester.widget (find.text (r'\lambda' , findRichText: true ));
564
568
});
@@ -1141,6 +1145,23 @@ void main() {
1141
1145
testContentSmoke (ContentExample .mathInline);
1142
1146
1143
1147
testWidgets ('maintains font-size ratio with surrounding text' , (tester) async {
1148
+ const html = '<span class="katex">'
1149
+ '<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1150
+ '<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
1151
+ '<span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">λ</span></span></span></span>' ;
1152
+ await checkFontSizeRatio (tester,
1153
+ targetHtml: html,
1154
+ targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'λ' ));
1155
+ }, skip: true // TODO(#46): adapt this test
1156
+ // (it needs a more complex targetFontSizeFinder;
1157
+ // see other uses in this file for examples.)
1158
+ );
1159
+
1160
+ testWidgets ('maintains font-size ratio with surrounding text, when showing TeX source' , (tester) async {
1161
+ addTearDown (testBinding.reset);
1162
+ final globalSettings = testBinding.globalStore.settings;
1163
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1164
+
1144
1165
const html = '<span class="katex">'
1145
1166
'<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1146
1167
'<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
@@ -1150,7 +1171,11 @@ void main() {
1150
1171
targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'\lambda' ));
1151
1172
});
1152
1173
1153
- testWidgets ('displays KaTeX source; experimental flag default' , (tester) async {
1174
+ testWidgets ('displays KaTeX source; experimental flag disabled' , (tester) async {
1175
+ addTearDown (testBinding.reset);
1176
+ final globalSettings = testBinding.globalStore.settings;
1177
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1178
+
1154
1179
await prepareContent (tester, plainContent (ContentExample .mathInline.html));
1155
1180
tester.widget (find.text (r'\lambda' , findRichText: true ));
1156
1181
});
0 commit comments