mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Parse single superscripts and subscripts
Summary: Add the ability to parse lone `^x` and `_y`, etc. This basically just involves more checking of cases in the increasingly ugly `parseAtom` function. Also, now we manually check for the cases of double superscripts and subscripts. Test Plan: Make sure the tests pass. Make sure things like `^x` and `_y` parse. Reviewers: emily Reviewed By: emily Differential Revision: http://phabricator.khanacademy.org/D3095
This commit is contained in:
4
katex.js
4
katex.js
@@ -27,6 +27,10 @@ var makeSpan = function(className, children) {
|
||||
};
|
||||
|
||||
var buildGroup = function(style, color, group, prev) {
|
||||
if (!group) {
|
||||
return makeSpan();
|
||||
}
|
||||
|
||||
if (group.type === "mathord") {
|
||||
return makeSpan("mord" + color, [mathit(group.value)]);
|
||||
} else if (group.type === "textord") {
|
||||
|
Reference in New Issue
Block a user