Skip to content

Commit 432bfd6

Browse files
committed
shows txt file ext.
Signed-off-by: afzal442 <afzal442@gmail.com>
1 parent 307d1d5 commit 432bfd6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/CodeBlock.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export default {
4343
// computed properties
4444
const className = computed(() => {
4545
if (props.lang === 'txt') {
46-
return 'language-markup'
46+
return 'language-text'
4747
}
4848
return `language-${lang.value}`
4949
})
5050
const highlightCode = computed(() => {
5151
if (lang.value === 'txt') {
52-
return highlight(code.value, languages['markup'], 'markup')
52+
return highlight(code.value, {}, 'txt')
5353
}
5454
return highlight(code.value, languages[lang.value], lang.value)
5555
})
@@ -149,6 +149,11 @@ div[class~='language-markdown']::before {
149149
content: 'md';
150150
}
151151
152+
div[class~='language-txt']::before,
153+
div[class~='language-text']::before {
154+
content: 'txt';
155+
}
156+
152157
div[class~='language-json']::before {
153158
content: 'json';
154159
}

0 commit comments

Comments
 (0)