MCPcopy Index your code
hub / github.com/messageformat/messageformat / D

Function D

docs/scripts/prettify/prettify.js:190–244  ·  view source on GitHub ↗
(a, m)

Source from the content-addressed store, hash-verified

188 }
189
190 function D(a, m) {
191 function e(a) {
192 switch (a.nodeType) {
193 case 1:
194 if (k.test(a.className)) break;
195 if ("BR" === a.nodeName) h(a), a.parentNode && a.parentNode.removeChild(a);
196 else for (a = a.firstChild; a; a = a.nextSibling) e(a);
197 break;
198 case 3:
199 case 4:
200 if (p) {
201 var b = a.nodeValue,
202 d = b.match(t);
203 if (d) {
204 var c = b.substring(0, d.index);
205 a.nodeValue = c;
206 (b = b.substring(d.index + d[0].length)) && a.parentNode.insertBefore(s.createTextNode(b), a.nextSibling);
207 h(a);
208 c || a.parentNode.removeChild(a)
209 }
210 }
211 }
212 }
213
214 function h(a) {
215 function b(a, d) {
216 var e = d ? a.cloneNode(!1) : a,
217 f = a.parentNode;
218 if (f) {
219 var f = b(f, 1),
220 g = a.nextSibling;
221 f.appendChild(e);
222 for (var h = g; h; h = g) g = h.nextSibling, f.appendChild(h)
223 }
224 return e
225 }
226 for (; !a.nextSibling;) if (a = a.parentNode, !a) return;
227 for (var a = b(a.nextSibling, 0), e;
228 (e = a.parentNode) && e.nodeType === 1;) a = e;
229 d.push(a)
230 }
231 var k = /(?:^|\s)nocode(?:\s|$)/,
232 t = /\r\n?|\n/,
233 s = a.ownerDocument,
234 l;
235 a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = s.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
236 var p = l && "pre" === l.substring(0, 3);
237 for (l = s.createElement("LI"); a.firstChild;) l.appendChild(a.firstChild);
238 for (var d = [l], g = 0; g < d.length; ++g) e(d[g]);
239 m === (m | 0) && d[0].setAttribute("value", m);
240 var r = s.createElement("OL");
241 r.className = "linenums";
242 for (var n = Math.max(0, m - 1 | 0) || 0, g = 0, z = d.length; g < z; ++g) l = d[g], l.className = "L" + (g + n) % 10, l.firstChild || l.appendChild(s.createTextNode("\xa0")), r.appendChild(l);
243 a.appendChild(r)
244 }
245
246 function k(a, m) {
247 for (var e = m.length; --e >= 0;) {

Callers 2

prettify.jsFile · 0.70
mFunction · 0.70

Calls 1

eFunction · 0.70

Tested by

no test coverage detected