Skip to content

Commit

Permalink
feat(plugin-shikiji): remove notation escape
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Jun 25, 2024
1 parent 787626e commit 074ade9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/plugin-shikiji/src/node/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
transformerNotationFocus,
transformerNotationHighlight,
transformerNotationWordHighlight,
transformerRemoveNotationEscape,
transformerRenderWhitespace,
} from '@shikijs/transformers'
import type { HighlighterOptions, ThemeOptions } from './types.js'
Expand All @@ -25,7 +26,6 @@ const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 10)
const cache = new LRUCache<string, string>(64)

const vueRE = /-vue$/
const RE_ESCAPE = /\[\\\!code/g
const mustacheRE = /\{\{.*?\}\}/g
const decorationsRE = /^\/\/ @decorations:(.*?)\n/

Expand Down Expand Up @@ -85,10 +85,7 @@ export async function highlight(
return code
},
},
{
name: 'vuepress:remove-escape',
postprocess: code => code.replace(RE_ESCAPE, '[!code'),
},
transformerRemoveNotationEscape(),
]

const loadedLanguages = highlighter.getLoadedLanguages()
Expand Down

0 comments on commit 074ade9

Please sign in to comment.