MCPcopy Create free account
hub / github.com/socketstream/socketstream / applyDecorator

Function applyDecorator

docs/js/google-code-prettify.js:1359–1382  ·  view source on GitHub ↗
(job)

Source from the content-addressed store, hash-verified

1357 createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
1358
1359 function applyDecorator(job) {
1360 var opt_langExtension = job.langExtension;
1361
1362 try {
1363 // Extract tags, and convert the source code to plain text.
1364 var sourceAndSpans = extractSourceSpans(job.sourceNode, job.pre);
1365 /** Plain text. @type {string} */
1366 var source = sourceAndSpans.sourceCode;
1367 job.sourceCode = source;
1368 job.spans = sourceAndSpans.spans;
1369 job.basePos = 0;
1370
1371 // Apply the appropriate language handler
1372 langHandlerForExtension(opt_langExtension, source)(job);
1373
1374 // Integrate the decorations and tags back into the source code,
1375 // modifying the sourceNode in place.
1376 recombineTagsAndDecorations(job);
1377 } catch (e) {
1378 if (win['console']) {
1379 console['log'](e && e['stack'] ? e['stack'] : e);
1380 }
1381 }
1382 }
1383
1384 /**
1385 * @param sourceCodeHtml {string} The HTML to pretty print.

Callers 2

prettyPrintOneFunction · 0.85
doWorkFunction · 0.85

Calls 3

extractSourceSpansFunction · 0.85
langHandlerForExtensionFunction · 0.85

Tested by

no test coverage detected