fix(code-block-lowlight): support for lowlight v3 aliases (#5551)

This commit is contained in:
Ilya Iskra 2024-08-26 14:14:23 +05:00 committed by GitHub
parent 58e91c4175
commit 9907eb32c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@tiptap/extension-code-block-lowlight": patch
---
Add support for lowlight v3 aliases

View File

@ -49,7 +49,7 @@ function getDecorations({
const language = block.node.attrs.language || defaultLanguage
const languages = lowlight.listLanguages()
const nodes = language && (languages.includes(language) || registered(language))
const nodes = language && (languages.includes(language) || registered(language) || lowlight.registered?.(language))
? getHighlightNodes(lowlight.highlight(language, block.node.textContent))
: getHighlightNodes(lowlight.highlightAuto(block.node.textContent))