Skip to content

Commit

Permalink
Merge pull request #76 from uni-helper/fix/jsonc-parse
Browse files Browse the repository at this point in the history
fix: jsonc parse is empty
  • Loading branch information
KeJunMao authored Apr 15, 2023
2 parents cfcb78d + 03576cd commit c51afdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/customBlock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs'
import fs from 'node:fs'
import JSON5 from 'json5'
import { parse as YAMLParser } from 'yaml'
import { parse as VueParser } from '@vue/compiler-sfc'
Expand Down Expand Up @@ -38,7 +38,7 @@ export function parseCustomBlock(
let content: Record<string, any> | undefined
debug.routeBlock(`use ${lang} parser`)

if (lang === 'json5') {
if (lang === 'json5' || lang === 'jsonc') {
try {
content = JSON5.parse(block.content)
}
Expand Down

0 comments on commit c51afdd

Please sign in to comment.