Sand3D-assets-explorer / src /python-highlight.ts
fffiloni's picture
Add object inspection modes and highlighted Python reader (1.1.0)
2abf76f verified
Raw History Blame Contribute Delete
348 Bytes
import hljs from 'highlight.js/lib/core';
import python from 'highlight.js/lib/languages/python';
hljs.registerLanguage('python',python);
/** highlight.js escapes source text; only its own fixed token spans become HTML. */
export function highlightPython(source:string){return hljs.highlight(source,{language:'python',ignoreIllegals:true}).value;}