mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-08 01:53:04 +08:00
fix(code-block-lowlight): support for lowlight v3 aliases (#5551)
This commit is contained in:
parent
58e91c4175
commit
9907eb32c2
5
.changeset/sweet-ants-lick.md
Normal file
5
.changeset/sweet-ants-lick.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tiptap/extension-code-block-lowlight": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add support for lowlight v3 aliases
|
@ -49,7 +49,7 @@ function getDecorations({
|
|||||||
const language = block.node.attrs.language || defaultLanguage
|
const language = block.node.attrs.language || defaultLanguage
|
||||||
const languages = lowlight.listLanguages()
|
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.highlight(language, block.node.textContent))
|
||||||
: getHighlightNodes(lowlight.highlightAuto(block.node.textContent))
|
: getHighlightNodes(lowlight.highlightAuto(block.node.textContent))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user