Skip to content

Commit

Permalink
docs: show previous API in a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 committed Aug 6, 2024
1 parent 24a2817 commit 83f4f31
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions demos/src/Nodes/CodeBlockLowlight/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,26 @@ import html from 'highlight.js/lib/languages/xml'
import { all, createLowlight } from 'lowlight'
import React from 'react'

// create a lowlight instance
// create a lowlight instance with all languages loaded
const lowlight = createLowlight(all)

// you can also register languages
// This is only an example, all supported languages are already loaded above
// but you can also register only specific languages to reduce bundle-size
lowlight.register('html', html)
lowlight.register('css', css)
lowlight.register('js', js)
lowlight.register('ts', ts)

/**
* Lowlight version 2.x had a different API
* import { lowlight } from 'lowlight'
*
* lowlight.registerLanguage('html', html)
* lowlight.registerLanguage('css', css)
* lowlight.registerLanguage('js', js)
* lowlight.registerLanguage('ts', ts)
*/

export default () => {
const editor = useEditor({
extensions: [
Expand Down

0 comments on commit 83f4f31

Please sign in to comment.