Skip to content

Commit

Permalink
fix(extension-code-block-lowlight): support for lowlight v3 aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya-Iskra committed Aug 26, 2024
1 parent 58e91c4 commit 2266827
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sweet-ants-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/extension-code-block-lowlight": patch
---

Add support for lowlight v3 aliases
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 2266827

Please sign in to comment.