mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 04:28:41 +00:00
Add support for \text{rm,it,bf,tt,sf,normal}.
And allow \text to nest inside \text.
This commit is contained in:
@@ -1382,6 +1382,43 @@ describe("An HTML font tree-builder", function() {
|
||||
expect(markup).toContain("<span class=\"mord mathfrak\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\text{R} with the correct font", function() {
|
||||
var markup = katex.renderToString("\\text{R}");
|
||||
expect(markup).toContain("<span class=\"mord mathrm\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\textit{R} with the correct font", function() {
|
||||
var markup = katex.renderToString("\\textit{R}");
|
||||
expect(markup).toContain("<span class=\"mord textit\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\text{\\textit{R}} with the correct font", function() {
|
||||
var markup = katex.renderToString("\\text{\\textit{R}}");
|
||||
expect(markup).toContain("<span class=\"mord textit\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\text{R\\textit{S}T} with the correct fonts", function() {
|
||||
var markup = katex.renderToString("\\text{R\\textit{S}T}");
|
||||
expect(markup).toContain("<span class=\"mord mathrm\">R</span>");
|
||||
expect(markup).toContain("<span class=\"mord textit\">S</span>");
|
||||
expect(markup).toContain("<span class=\"mord mathrm\">T</span>");
|
||||
});
|
||||
|
||||
it("should render \\textbf{R} with the correct font", function() {
|
||||
var markup = katex.renderToString("\\textbf{R}");
|
||||
expect(markup).toContain("<span class=\"mord mathbf\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\textsf{R} with the correct font", function() {
|
||||
var markup = katex.renderToString("\\textsf{R}");
|
||||
expect(markup).toContain("<span class=\"mord mathsf\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\texttt{R} with the correct font", function() {
|
||||
var markup = katex.renderToString("\\texttt{R}");
|
||||
expect(markup).toContain("<span class=\"mord mathtt\">R</span>");
|
||||
});
|
||||
|
||||
it("should render a combination of font and color changes", function() {
|
||||
var markup = katex.renderToString("\\color{blue}{\\mathbb R}");
|
||||
var span = "<span class=\"mord mathbb\" style=\"color:blue;\">R</span>";
|
||||
|
Reference in New Issue
Block a user