mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 18:10:54 +08:00
Merge pull request #250 from sviptzk/dev
F 修复某种情况下导致highlight没有第二个class名(plain)而导致的代码语言变为undefined
This commit is contained in:
@@ -278,7 +278,7 @@ $(function () {
|
||||
var langNameIndex, langName
|
||||
$figureHighlight.each(function () {
|
||||
langNameIndex = langName = $(this).attr('class').split(' ')[1]
|
||||
if (langNameIndex === 'plain') langName = 'Code'
|
||||
if (langNameIndex === 'plain' || langNameIndex === undefined) langName = 'Code'
|
||||
$(this).find('.highlight-tools').append('<div class="code-lang">' + langName + '</div>')
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user