fix: open text files
This commit is contained in:
parent
9d53628e19
commit
ee6ceb4c64
2 changed files with 9 additions and 2 deletions
|
|
@ -12,7 +12,11 @@ export function Code(props: Props) {
|
|||
const ctx = useLocal()
|
||||
const highlighter = useShiki()
|
||||
const [local, others] = splitProps(props, ["class", "classList", "code", "path"])
|
||||
const lang = createMemo(() => getFileExtension(local.path))
|
||||
const lang = createMemo(() => {
|
||||
const ext = getFileExtension(local.path)
|
||||
if (ext in bundledLanguages) return ext
|
||||
return "text"
|
||||
})
|
||||
|
||||
let container: HTMLDivElement | undefined
|
||||
let isProgrammaticSelection = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue