fix: do not show language picker in code block

This commit is contained in:
jocs 2018-10-24 00:27:55 +08:00
parent d127c3f4cb
commit 49cab6dc11

View File

@ -16,7 +16,7 @@ const checkEditLanguage = (paragraph, selectionState) => {
const text = paragraph.textContent
const { start } = selectionState
const token = text.match(/(^`{3,})([^`]+)/)
if (paragraph.tagName !== 'SPAN') return false
if (paragraph.tagName !== 'SPAN' || paragraph.classList.contains('ag-code-line')) return false
if (token) {
const len = token[1].length
const lang = token[2].trim()