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;}