Spaces:
Running
Running
Download src/python-highlight.ts from fffiloni/Sand3D-assets-explorer: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/spaces/fffiloni/Sand3D-assets-explorer/resolve/main/src/python-highlight.ts
- Command line
-
hf download hf://spaces/fffiloni/Sand3D-assets-explorer/src/python-highlight.ts
-
curl -L -o python-highlight.ts https://huggingface.co/spaces/fffiloni/Sand3D-assets-explorer/resolve/main/src/python-highlight.ts
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;} | |