diff options
Diffstat (limited to 'app/assets/javascripts/content_editor/extensions/code_block_highlight.js')
-rw-r--r-- | app/assets/javascripts/content_editor/extensions/code_block_highlight.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/content_editor/extensions/code_block_highlight.js b/app/assets/javascripts/content_editor/extensions/code_block_highlight.js index cc4ba84a29d..61f6a233694 100644 --- a/app/assets/javascripts/content_editor/extensions/code_block_highlight.js +++ b/app/assets/javascripts/content_editor/extensions/code_block_highlight.js @@ -4,7 +4,8 @@ import { VueNodeViewRenderer } from '@tiptap/vue-2'; import languageLoader from '../services/code_block_language_loader'; import CodeBlockWrapper from '../components/wrappers/code_block.vue'; -const extractLanguage = (element) => element.getAttribute('lang'); +const extractLanguage = (element) => element.dataset.canonicalLang ?? element.getAttribute('lang'); + export const backtickInputRegex = /^```([a-z]+)?[\s\n]$/; export const tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/; |