Skip to content

Commit

Permalink
feat(plugin-prismjs): add prismjs classname to <pre> (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo authored May 29, 2024
1 parent 3942641 commit 2ac6c53
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 56 deletions.
5 changes: 5 additions & 0 deletions plugins/plugin-prismjs/src/node/markdown/highlightPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export const highlightPlugin = (
notationHighlight(parser)
}

/**
* Add the `prismjs` class name to distinguish the highlight library used for the current code block.
*/
parser.pre.classList.push('prismjs')

parser.pre.classList.push(languageClass)

return parser.stringify()
Expand Down
Loading

0 comments on commit 2ac6c53

Please sign in to comment.