refactor(tiptap-extensions): Do not import the full lowlight library.
BREAKING CHANGE: `CodeBlockHighlight` was importing the full `lowlight` libraries, including _all_ syntax highlightning definitions from `highlight.js`. The new behavior changes the signature of `CodeBlockHighlight` to accept an object with all syntax highlightning definitions. This means that now the user of the library __MUST__ import languages themselves and tiptap will no longer bundle the full `highlight.js` in itself.
This commit is contained in:
@@ -26,3 +26,25 @@ body, .usertext {
|
||||
content: attr(href)
|
||||
}
|
||||
}`
|
||||
|
||||
|
||||
export const explicitImportExample = `import javascript from 'highlight.js/lib/languages/javascript'
|
||||
import { Editor } from 'tiptap'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Editor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
extensions: [
|
||||
new CodeBlockHighlightNode({
|
||||
languages: {
|
||||
javascript,
|
||||
css
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
Reference in New Issue
Block a user