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

Function langHandlerForExtension

docs/js/google-code-prettify.js:1249–1258  ·  view source on GitHub ↗
(extension, source)

Source from the content-addressed store, hash-verified

1247 }
1248 }
1249 function langHandlerForExtension(extension, source) {
1250 if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
1251 // Treat it as markup if the first non whitespace character is a < and
1252 // the last non-whitespace character is a >.
1253 extension = /^\s*</.test(source)
1254 ? 'default-markup'
1255 : 'default-code';
1256 }
1257 return langHandlerRegistry[extension];
1258 }
1259 registerLangHandler(decorateSource, ['default-code']);
1260 registerLangHandler(
1261 createSimpleLexer(

Callers 2

decorateFunction · 0.85
applyDecoratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected