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

Function canCombine

static/katex/katex.mjs:5503–5521  ·  view source on GitHub ↗
(prev, next)

Source from the content-addressed store, hash-verified

5501
5502
5503const canCombine = (prev, next) => {
5504 if (createClass(prev.classes) !== createClass(next.classes) || prev.skew !== next.skew || prev.maxFontSize !== next.maxFontSize) {
5505 return false;
5506 }
5507
5508 for (const style in prev.style) {
5509 if (prev.style.hasOwnProperty(style) && prev.style[style] !== next.style[style]) {
5510 return false;
5511 }
5512 }
5513
5514 for (const style in next.style) {
5515 if (next.style.hasOwnProperty(style) && prev.style[style] !== next.style[style]) {
5516 return false;
5517 }
5518 }
5519
5520 return true;
5521};
5522/**
5523 * Combine consequetive domTree.symbolNodes into a single symbolNode.
5524 * Note: this function mutates the argument.

Callers 1

tryCombineCharsFunction · 0.85

Calls 1

createClassFunction · 0.70

Tested by

no test coverage detected