diff --git a/lib/hexo/default_config.js b/lib/hexo/default_config.js index ecf688faf8..3ef8cdd87d 100644 --- a/lib/hexo/default_config.js +++ b/lib/hexo/default_config.js @@ -47,6 +47,7 @@ module.exports = { tab_replace: '', wrap: true, exclude_languages: [], + language_attr: false, hljs: false }, prismjs: { diff --git a/lib/plugins/tag/code.js b/lib/plugins/tag/code.js index 4b2fdd07f0..9d0c9b4e19 100644 --- a/lib/plugins/tag/code.js +++ b/lib/plugins/tag/code.js @@ -185,7 +185,8 @@ module.exports = ctx => function codeTag(args, content) { mark, tab: hljsCfg.tab_replace, autoDetect: hljsCfg.auto_detect, - wrap: typeof wrap === 'boolean' ? wrap : hljsCfg.wrap + wrap: typeof wrap === 'boolean' ? wrap : hljsCfg.wrap, + languageAttr: hljsCfg.language_attr }; if (!highlight) highlight = require('hexo-util').highlight;