File size: 348 Bytes
2abf76f
 
 
 
 
1
2
3
4
5
6
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;}