-
Notifications
You must be signed in to change notification settings - Fork 324
KaTeX(6/n): Handle 'nulldelimiter' class in spans #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -643,6 +643,38 @@ class KatexExample extends ContentExample { | |||||
text: '∗'), | ||||||
]), | ||||||
]); | ||||||
|
||||||
static final nulldelimiter = KatexExample.block( | ||||||
r'null delimiters, like `\left.`', | ||||||
// https://chat.zulip.org/#narrow/channel/7-test-here/topic/Rajesh/near/2205534 | ||||||
r'\left. a \middle. b \right.', | ||||||
'<p>' | ||||||
'<span class="katex-display"><span class="katex">' | ||||||
'<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>a</mi><mo fence="true" lspace="0.05em" rspace="0.05em">.</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">\\left. a \\middle. b \\right.</annotation></semantics></math></span>' | ||||||
'<span class="katex-html" aria-hidden="true">' | ||||||
'<span class="base">' | ||||||
'<span class="strut" style="height:0.6944em;"></span>' | ||||||
'<span class="minner">' | ||||||
'<span class="mopen nulldelimiter"></span>' | ||||||
'<span class="mord mathnormal">a</span>' | ||||||
'<span class="nulldelimiter"></span>' | ||||||
'<span class="mord mathnormal">b</span>' | ||||||
'<span class="mclose nulldelimiter"></span></span></span></span></span></span></p>', [ | ||||||
KatexSpanNode(nodes: [ | ||||||
KatexStrutNode(heightEm: 0.6944, verticalAlignEm: null), | ||||||
KatexSpanNode(nodes: [ | ||||||
KatexSpanNode(styles: KatexSpanStyles(widthEm: 0.12), nodes: []), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: simplify
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm we need to specify an empty list here, because we currently require either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see, indeed. OK. |
||||||
KatexSpanNode( | ||||||
styles: KatexSpanStyles(fontFamily: 'KaTeX_Math', fontStyle: KatexSpanFontStyle.italic), | ||||||
text: 'a'), | ||||||
KatexSpanNode(styles: KatexSpanStyles(widthEm: 0.12), nodes: []), | ||||||
KatexSpanNode( | ||||||
styles: KatexSpanStyles(fontFamily: 'KaTeX_Math', fontStyle: KatexSpanFontStyle.italic), | ||||||
text: 'b'), | ||||||
KatexSpanNode(styles: KatexSpanStyles(widthEm: 0.12), nodes: []), | ||||||
]), | ||||||
]), | ||||||
]); | ||||||
} | ||||||
|
||||||
void main() async { | ||||||
|
@@ -663,6 +695,7 @@ void main() async { | |||||
testParseExample(KatexExample.textColor); | ||||||
testParseExample(KatexExample.customColorMacro); | ||||||
testParseExample(KatexExample.phantom); | ||||||
testParseExample(KatexExample.nulldelimiter); | ||||||
|
||||||
group('parseCssHexColor', () { | ||||||
const testCases = [ | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh interesting — I didn't know you could use
.
that way in TeX 🙂