Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit e68eb7f

Browse files
feat: optional terminal style
1 parent e73a31e commit e68eb7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ const toString = require("mdast-util-to-string")
33

44
const _ = require(`lodash`)
55

6-
module.exports = ({ markdownAST }, _pluginOptions) => {
6+
module.exports = ({ markdownAST }, pluginOptions) => {
7+
8+
const terminal = pluginOptions && pluginOptions.terminal && pluginOptions.terminal !== '' ? pluginOptions.terminal : undefined
9+
710
visit(markdownAST, "code", node => {
811
const text = toString(node)
912

1013
const html = `
11-
<deckgo-highlight-code ${node && node.lang !== null ? `language="${node.lang}"` : ''}>
14+
<deckgo-highlight-code ${node && node.lang !== null ? `language="${node.lang}"` : ''} ${terminal !== undefined ? `terminal="${terminal}"` : ''}>
1215
<code slot="code">${_.escape(text)}</code>
1316
</deckgo-highlight-code>
1417
`

0 commit comments

Comments
 (0)