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:
Erick Wilder
2018-10-13 16:22:33 +02:00
parent 3c650cf35f
commit 27e473c2a4
3 changed files with 65 additions and 9 deletions

View File

@@ -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
}
})
]
}
}
}`;