MCPcopy Create free account
hub / github.com/messageformat/messageformat / M

Function M

docs/scripts/prettify/prettify.js:83–110  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

81 }
82
83 function M(a) {
84 function m(a) {
85 switch (a.nodeType) {
86 case 1:
87 if (e.test(a.className)) break;
88 for (var g = a.firstChild; g; g = g.nextSibling) m(g);
89 g = a.nodeName;
90 if ("BR" === g || "LI" === g) h[s] = "\n", t[s << 1] = y++, t[s++ << 1 | 1] = a;
91 break;
92 case 3:
93 case 4:
94 g = a.nodeValue, g.length && (g = p ? g.replace(/\r\n?/g, "\n") : g.replace(/[\t\n\r ]+/g, " "), h[s] = g, t[s << 1] = y, y += g.length, t[s++ << 1 | 1] = a)
95 }
96 }
97 var e = /(?:^|\s)nocode(?:\s|$)/,
98 h = [],
99 y = 0,
100 t = [],
101 s = 0,
102 l;
103 a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = document.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
104 var p = l && "pre" === l.substring(0, 3);
105 m(a);
106 return {
107 a: h.join("").replace(/\n$/, ""),
108 c: t
109 }
110 }
111
112 function B(a, m, e, h) {
113 m && (a = {

Callers 1

EFunction · 0.70

Calls 1

mFunction · 0.70

Tested by

no test coverage detected