Skip to content

Commit 32eec9c

Browse files
authored
fix(highlight): respect highlight option (#1372)
1 parent b832f24 commit 32eec9c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/runtime/transformers/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ import markdown from './markdown'
66
import yaml from './yaml'
77
import pathMeta from './path-meta'
88
import json from './json'
9-
import highlight from './shiki'
109

1110
const TRANSFORMERS = [
1211
csv,
1312
markdown,
1413
json,
1514
yaml,
16-
pathMeta,
17-
highlight
15+
pathMeta
1816
]
1917

20-
function getParser (ext, additionalTransformers: ContentTransformer[] = []): ContentTransformer {
18+
function getParser (ext, additionalTransformers: ContentTransformer[] = []): ContentTransformer | undefined {
2119
let parser = additionalTransformers.find(p => ext.match(new RegExp(p.extensions.join('|'), 'i')) && p.parse)
2220
if (!parser) {
2321
parser = TRANSFORMERS.find(p => ext.match(new RegExp(p.extensions.join('|'), 'i')) && p.parse)
@@ -42,7 +40,7 @@ export async function transformContent (id, content, options: TransformContentOp
4240
const file = { _id: id, body: content }
4341

4442
const ext = extname(id)
45-
const parser: ContentTransformer = getParser(ext, transformers)
43+
const parser = getParser(ext, transformers)
4644
if (!parser) {
4745
// eslint-disable-next-line no-console
4846
console.warn(`${ext} files are not supported, "${id}" falling back to raw content`)

0 commit comments

Comments
 (0)