Skip to content

Commit

Permalink
feat(tag/code): add languageAttr option (hexojs/hexo-util#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
renbaoshuo committed Jul 16, 2022
1 parent 8a08bb9 commit dca2282
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/hexo/default_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
tab_replace: '',
wrap: true,
exclude_languages: [],
language_attr: false,
hljs: false
},
prismjs: {
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/tag/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dca2282

Please sign in to comment.