MCPcopy Create free account
hub / github.com/TruthHun/BookStack / constructor

Method constructor

static/katex/katex.mjs:6731–6758  ·  view source on GitHub ↗

* Create a Space node with width given in CSS ems.

(width)

Source from the content-addressed store, hash-verified

6729 * Create a Space node with width given in CSS ems.
6730 */
6731 constructor(width) {
6732 this.width = void 0;
6733 this.character = void 0;
6734 this.width = width; // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
6735 // for a table of space-like characters. We use Unicode
6736 // representations instead of &LongNames; as it's not clear how to
6737 // make the latter via document.createTextNode.
6738
6739 if (width >= 0.05555 && width <= 0.05556) {
6740 this.character = "\u200a"; // &VeryThinSpace;
6741 } else if (width >= 0.1666 && width <= 0.1667) {
6742 this.character = "\u2009"; // &ThinSpace;
6743 } else if (width >= 0.2222 && width <= 0.2223) {
6744 this.character = "\u2005"; // &MediumSpace;
6745 } else if (width >= 0.2777 && width <= 0.2778) {
6746 this.character = "\u2005\u200a"; // &ThickSpace;
6747 } else if (width >= -0.05556 && width <= -0.05555) {
6748 this.character = "\u200a\u2063"; // &NegativeVeryThinSpace;
6749 } else if (width >= -0.1667 && width <= -0.1666) {
6750 this.character = "\u2009\u2063"; // &NegativeThinSpace;
6751 } else if (width >= -0.2223 && width <= -0.2222) {
6752 this.character = "\u205f\u2063"; // &NegativeMediumSpace;
6753 } else if (width >= -0.2778 && width <= -0.2777) {
6754 this.character = "\u2005\u2063"; // &NegativeThickSpace;
6755 } else {
6756 this.character = null;
6757 }
6758 }
6759 /**
6760 * Converts the math node into a MathML-namespaced DOM element.
6761 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected