MCPcopy
hub / github.com/tmcw/big / o

Function o

lib/highlight.js:55–88  ·  view source on GitHub ↗
(e, a, n)

Source from the content-addressed store, hash-verified

53 })(e, 0), t;
54 }
55 function o(e, a, n) {
56 function i() {
57 return e.length && a.length
58 ? e[0].offset !== a[0].offset
59 ? e[0].offset < a[0].offset ? e : a
60 : 'start' === a[0].event ? e : a
61 : e.length ? e : a;
62 }
63 function s(e) {
64 function a(e) {
65 return (
66 ' ' + e.nodeName + '="' + t(e.value).replace('"', '&quot;') + '"'
67 );
68 }
69 u += '<' + r(e) + N.map.call(e.attributes, a).join('') + '>';
70 }
71 function c(e) {
72 u += '</' + r(e) + '>';
73 }
74 function o(e) {
75 ('start' === e.event ? s : c)(e.node);
76 }
77 for (var l = 0, u = '', d = []; e.length || a.length; ) {
78 var b = i();
79 if (((u += t(n.substring(l, b[0].offset))), (l = b[0].offset), b === e)) {
80 d.reverse().forEach(c);
81 do
82 o(b.splice(0, 1)[0]), (b = i());
83 while (b === e && b.length && b[0].offset === l);
84 d.reverse().forEach(s);
85 } else 'start' === b[0].event ? d.push(b[0].node) : d.pop(), o(b.splice(0, 1)[0]);
86 }
87 return u + t(n.substr(l));
88 }
89 function l(e) {
90 return e.v &&
91 !e.cached_variants &&

Callers 2

hFunction · 0.85
fFunction · 0.85

Calls 3

iFunction · 0.85
tFunction · 0.85
aFunction · 0.85

Tested by

no test coverage detected