@@ -1031,17 +1031,16 @@ void main() {
1031
1031
group ('fallback to displaying KaTeX source if unsupported KaTeX HTML' , () {
1032
1032
testContentSmoke (ContentExample .mathInlineUnknown);
1033
1033
1034
+ assert (ContentExample .mathInlineUnknown.html.startsWith ('<p>' ));
1035
+ assert (ContentExample .mathInlineUnknown.html.endsWith ('</p>' ));
1036
+ final unsupportedKatexHtml = ContentExample .mathInlineUnknown.html
1037
+ .substring (3 , ContentExample .mathInlineUnknown.html.length - 4 );
1038
+ final expectedText = ContentExample .mathInlineUnknown.expectedText! ;
1039
+
1034
1040
testWidgets ('maintains font-size ratio with surrounding text, when falling back to TeX source' , (tester) async {
1035
- const unsupportedHtml = '<span class="katex">'
1036
- '<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1037
- '<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
1038
- '<span class="katex-html" aria-hidden="true">'
1039
- '<span class="base unknown">' // Server doesn't generate this 'unknown' class.
1040
- '<span class="strut" style="height:0.6944em;"></span>'
1041
- '<span class="mord mathnormal">λ</span></span></span></span>' ;
1042
1041
await checkFontSizeRatio (tester,
1043
- targetHtml: unsupportedHtml ,
1044
- targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'\lambda' ));
1042
+ targetHtml: unsupportedKatexHtml ,
1043
+ targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (expectedText ));
1045
1044
});
1046
1045
});
1047
1046
});
0 commit comments