Skip to content

Commit fe2818f

Browse files
katex: Explain reason for ignoring .vlist-t2 and .vlist-s CSS classes
Fixes: #1716
1 parent f304ec4 commit fe2818f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/model/katex.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,21 @@ class _KatexParser {
356356
}
357357
}
358358

359-
// TODO(#1716) Handle styling for .vlist-t2 spans
359+
// The katex.css has .vlist-t2 and .vlist-s classes for working around
360+
// Safari rendering issues. In HTML the .vlist-t2 class will be present
361+
// along with the .vlist-t class, and .vlist-s class will be present on
362+
// an empty span in the first (of the two) .vlist-r span.
363+
//
364+
// The KaTeX implementation confirms that both classes are always
365+
// present in tandem. And by experimenting via browser devtools and
366+
// the CSS definition and, it can be confirmed that both cancel each
367+
// others effect of the 2px shift.
368+
// See:
369+
// https://github.com/KaTeX/KaTeX/blob/9fb63136e/src/buildCommon.js#L596-L620
370+
// https://github.com/KaTeX/KaTeX/commit/766487bfe
371+
//
372+
// So, we ignore these classes, as those workarounds aren't needed.
373+
360374
return KatexVlistNode(
361375
rows: rows,
362376
debugHtmlNode: kDebugMode ? element : null,

0 commit comments

Comments
 (0)