diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-16 00:10:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-16 00:10:04 +0300 |
commit | ec3e75cfeadc943e3fc63ac5e6b5504ad43ea512 (patch) | |
tree | 79bc910fc137d5c46d6670a98e74a0438486f0bf /app/assets/javascripts/content_editor | |
parent | 36b47b4bd3eb88b08323cb26f5863e1dacdb18b7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/content_editor')
-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]$/; |