From 432bfd642b4a02f83d3703d20a8223d232bb3630 Mon Sep 17 00:00:00 2001 From: afzal442 Date: Sun, 3 Oct 2021 11:05:27 +0530 Subject: [PATCH] shows txt file ext. Signed-off-by: afzal442 --- src/components/CodeBlock.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/CodeBlock.vue b/src/components/CodeBlock.vue index 679c143f..99056181 100644 --- a/src/components/CodeBlock.vue +++ b/src/components/CodeBlock.vue @@ -43,13 +43,13 @@ export default { // computed properties const className = computed(() => { if (props.lang === 'txt') { - return 'language-markup' + return 'language-text' } return `language-${lang.value}` }) const highlightCode = computed(() => { if (lang.value === 'txt') { - return highlight(code.value, languages['markup'], 'markup') + return highlight(code.value, {}, 'txt') } return highlight(code.value, languages[lang.value], lang.value) }) @@ -149,6 +149,11 @@ div[class~='language-markdown']::before { content: 'md'; } +div[class~='language-txt']::before, +div[class~='language-text']::before { + content: 'txt'; +} + div[class~='language-json']::before { content: 'json'; }