@@ -93,7 +93,7 @@ MathParserResult? parseMath(dom.Element element, { required bool block }) {
9393 final parser = _KatexParser ();
9494 try {
9595 nodes = parser.parseKatexHtml (katexHtmlElement);
96- } on KatexHtmlParseError catch (e, st) {
96+ } on _KatexHtmlParseError catch (e, st) {
9797 assert (debugLog ('$e \n $st ' ));
9898 }
9999
@@ -123,7 +123,7 @@ class _KatexParser {
123123 if (node case dom.Element (localName: 'span' )) {
124124 return _parseSpan (node);
125125 } else {
126- throw KatexHtmlParseError ();
126+ throw _KatexHtmlParseError ();
127127 }
128128 }));
129129 }
@@ -303,48 +303,48 @@ class _KatexParser {
303303 case 'fontsize-ensurer' :
304304 // .sizing,
305305 // .fontsize-ensurer { ... }
306- if (index + 2 > spanClasses.length) throw KatexHtmlParseError ();
306+ if (index + 2 > spanClasses.length) throw _KatexHtmlParseError ();
307307 final resetSizeClass = spanClasses[index++ ];
308308 final sizeClass = spanClasses[index++ ];
309309
310310 final resetSizeClassSuffix = _resetSizeClassRegExp.firstMatch (resetSizeClass)? .group (1 );
311- if (resetSizeClassSuffix == null ) throw KatexHtmlParseError ();
311+ if (resetSizeClassSuffix == null ) throw _KatexHtmlParseError ();
312312 final sizeClassSuffix = _sizeClassRegExp.firstMatch (sizeClass)? .group (1 );
313- if (sizeClassSuffix == null ) throw KatexHtmlParseError ();
313+ if (sizeClassSuffix == null ) throw _KatexHtmlParseError ();
314314
315315 const sizes = < double > [0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1 , 1.2 , 1.44 , 1.728 , 2.074 , 2.488 ];
316316
317317 final resetSizeIdx = int .parse (resetSizeClassSuffix, radix: 10 );
318318 final sizeIdx = int .parse (sizeClassSuffix, radix: 10 );
319319
320320 // These indexes start at 1.
321- if (resetSizeIdx > sizes.length) throw KatexHtmlParseError ();
322- if (sizeIdx > sizes.length) throw KatexHtmlParseError ();
321+ if (resetSizeIdx > sizes.length) throw _KatexHtmlParseError ();
322+ if (sizeIdx > sizes.length) throw _KatexHtmlParseError ();
323323 fontSizeEm = sizes[sizeIdx - 1 ] / sizes[resetSizeIdx - 1 ];
324324
325325 case 'delimsizing' :
326326 // .delimsizing { ... }
327- if (index + 1 > spanClasses.length) throw KatexHtmlParseError ();
327+ if (index + 1 > spanClasses.length) throw _KatexHtmlParseError ();
328328 fontFamily = switch (spanClasses[index++ ]) {
329329 'size1' => 'KaTeX_Size1' ,
330330 'size2' => 'KaTeX_Size2' ,
331331 'size3' => 'KaTeX_Size3' ,
332332 'size4' => 'KaTeX_Size4' ,
333333 'mult' =>
334334 // TODO handle nested spans with `.delim-size{1,4}` class.
335- throw KatexHtmlParseError (),
336- _ => throw KatexHtmlParseError (),
335+ throw _KatexHtmlParseError (),
336+ _ => throw _KatexHtmlParseError (),
337337 };
338338
339339 // TODO handle .nulldelimiter and .delimcenter .
340340
341341 case 'op-symbol' :
342342 // .op-symbol { ... }
343- if (index + 1 > spanClasses.length) throw KatexHtmlParseError ();
343+ if (index + 1 > spanClasses.length) throw _KatexHtmlParseError ();
344344 fontFamily = switch (spanClasses[index++ ]) {
345345 'small-op' => 'KaTeX_Size1' ,
346346 'large-op' => 'KaTeX_Size2' ,
347- _ => throw KatexHtmlParseError (),
347+ _ => throw _KatexHtmlParseError (),
348348 };
349349
350350 // TODO handle more classes from katex.scss
@@ -392,7 +392,7 @@ class _KatexParser {
392392 } else {
393393 spans = _parseChildSpans (element.nodes);
394394 }
395- if (text == null && spans == null ) throw KatexHtmlParseError ();
395+ if (text == null && spans == null ) throw _KatexHtmlParseError ();
396396
397397 return KatexSpanNode (
398398 styles: inlineStyles != null
@@ -429,15 +429,15 @@ class _KatexParser {
429429 ' ${expression .toDebugString ()}' ));
430430 _hasError = true ;
431431 } else {
432- throw KatexHtmlParseError ();
432+ throw _KatexHtmlParseError ();
433433 }
434434 }
435435
436436 return KatexSpanStyles (
437437 heightEm: heightEm,
438438 );
439439 } else {
440- throw KatexHtmlParseError ();
440+ throw _KatexHtmlParseError ();
441441 }
442442 }
443443 return null ;
@@ -540,9 +540,10 @@ class KatexSpanStyles {
540540 }
541541}
542542
543- class KatexHtmlParseError extends Error {
543+ class _KatexHtmlParseError extends Error {
544544 final String ? message;
545- KatexHtmlParseError ([this .message]);
545+
546+ _KatexHtmlParseError ([this .message]);
546547
547548 @override
548549 String toString () {
0 commit comments