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