Skip to content

Commit

Permalink
Merge pull request #4476 from curbengh/prism-caption
Browse files Browse the repository at this point in the history
feat(highlight): parse 'caption' option to prismHighlight
  • Loading branch information
curbengh committed Aug 21, 2020
2 parents 8830389 + ae97b97 commit a7d6d8f
Show file tree
Hide file tree
Showing 7 changed files with 799 additions and 772 deletions.
3 changes: 2 additions & 1 deletion lib/plugins/filter/before_post_render/backtick_code_block.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function backtickCodeBlock(data) {
lineNumber: prismCfg.line_number,
tab: prismCfg.tab_replace,
isPreprocess: prismCfg.preprocess,
lang
lang,
caption
};

content = prismHighlight(content, options);
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/tag/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ module.exports = ctx => function codeTag(args, content) {
const prismjsOption = {
lang,
firstLine,
caption,
lineNumber: typeof line_number !== 'undefined' ? line_number : prismjsCfg.line_number,
mark,
tab: prismjsCfg.tab_replace,
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/tag/include_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module.exports = ctx => function includeCodeTag(args) {

const prismjsOptions = {
lang,
caption,
lineNumber: prismjsCfg.line_number,
tab: prismjsCfg.tab_replace,
isPreprocess: prismjsCfg.preprocess
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"hexo-fs": "^3.1.0",
"hexo-i18n": "^1.0.0",
"hexo-log": "^2.0.0",
"hexo-util": "^2.2.0",
"hexo-util": "^2.4.0",
"js-yaml": "^3.12.0",
"micromatch": "^4.0.2",
"moment": "^2.22.2",
Expand Down

0 comments on commit a7d6d8f

Please sign in to comment.