naive-ui/demo/store/hljs.js

21 lines
560 B
JavaScript
Raw Normal View History

import hljs from 'highlight.js/lib/core'
2020-03-18 13:42:48 +08:00
import javascript from 'highlight.js/lib/languages/javascript'
import python from 'highlight.js/lib/languages/python'
import cpp from 'highlight.js/lib/languages/cpp'
2021-02-05 16:38:01 +08:00
import xml from 'highlight.js/lib/languages/xml'
2020-03-18 13:42:48 +08:00
hljs.registerLanguage('javascript', javascript)
hljs.registerLanguage('python', python)
hljs.registerLanguage('cpp', cpp)
2021-02-05 16:38:01 +08:00
hljs.registerLanguage('html', xml)
2020-03-18 13:42:48 +08:00
hljs.registerLanguage('naive-log', () => ({
contains: [
{
className: 'number',
begin: /\d+/
}
]
}))
export default hljs