mirror of
https://github.com/marktext/marktext.git
synced 2025-05-04 09:30:49 +08:00
Merge pull request #1590 from marktext/fix-1582
Fix: unexpected load all languages
This commit is contained in:
commit
a2bad06d3c
@ -45,7 +45,10 @@ const codeBlockCtrl = ContentState => {
|
||||
* @param lang Language identifier
|
||||
*/
|
||||
ContentState.prototype.updateCodeLanguage = function (block, lang) {
|
||||
loadLanguage(lang)
|
||||
if (lang && typeof lang === 'string') {
|
||||
loadLanguage(lang)
|
||||
}
|
||||
|
||||
if (block.functionType === 'languageInput') {
|
||||
const preBlock = this.getParent(block)
|
||||
const nextSibling = this.getNextSibling(block)
|
||||
@ -102,7 +105,9 @@ const codeBlockCtrl = ContentState => {
|
||||
functionType: 'languageInput'
|
||||
})
|
||||
|
||||
loadLanguage(language)
|
||||
if (language) {
|
||||
loadLanguage(language)
|
||||
}
|
||||
|
||||
block.type = 'pre'
|
||||
block.functionType = 'fencecode'
|
||||
|
Loading…
Reference in New Issue
Block a user