mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-13 23:18:38 +00:00
Support \colorbox and \fcolorbox (#886)
* Support \colorbox and \\fcolorbox These are functions from the `color` package. They accept text, not math. They also have padding similar to `\fbox`. Because of the padding, the code in `buildHTML` is intermixed with the `\fbox` code. I have not (yet) created a new file in the functions folder. This way, the reviewer gets a cleaner diff. * Fix lint error * colorbox screenshots * Pick up review comments
This commit is contained in:
@@ -254,11 +254,13 @@ const encloseSpan = function(inner, label, pad, options) {
|
||||
let img;
|
||||
const totalHeight = inner.height + inner.depth + 2 * pad;
|
||||
|
||||
if (label === "fbox") {
|
||||
if (/(fbox)|(color)/.test(label)) {
|
||||
img = buildCommon.makeSpan(["stretchy", label], [], options);
|
||||
if (options.color) {
|
||||
|
||||
if (label === "fbox" && options.color) {
|
||||
img.style.borderColor = options.getColor();
|
||||
}
|
||||
|
||||
} else {
|
||||
// \cancel, \bcancel, or \xcancel
|
||||
// Since \cancel's SVG is inline and it omits the viewBox attribute,
|
||||
|
Reference in New Issue
Block a user