From 059aeef6a095df37109a3cf560850afd7a760913 Mon Sep 17 00:00:00 2001
From: takonomura <takonomura@users.noreply.github.com>
Date: Mon, 19 Oct 2020 08:37:07 +0900
Subject: MFM のバッククオートで囲ったコードが表示されないのを修正 (#6741)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/client/components/code-core.vue | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/client/components/code-core.vue')

diff --git a/src/client/components/code-core.vue b/src/client/components/code-core.vue
index cfb9d47ed9..9cff7b4448 100644
--- a/src/client/components/code-core.vue
+++ b/src/client/components/code-core.vue
@@ -1,17 +1,14 @@
 <template>
-<XPrism :inline="inline" :language="prismLang">{{ code }}</XPrism>
+<code v-if="inline" v-html="html" :class="`language-${prismLang}`"></code>
+<pre v-else :class="`language-${prismLang}`"><code v-html="html" :class="`language-${prismLang}`"></code></pre>
 </template>
 
 <script lang="ts">
 import { defineComponent } from 'vue';
 import 'prismjs';
 import 'prismjs/themes/prism-okaidia.css';
-import XPrism from 'vue-prism-component';import * as os from '@/os';
 
 export default defineComponent({
-	components: {
-		XPrism
-	},
 	props: {
 		code: {
 			type: String,
@@ -29,6 +26,9 @@ export default defineComponent({
 	computed: {
 		prismLang() {
 			return Prism.languages[this.lang] ? this.lang : 'js';
+		},
+		html() {
+			return Prism.highlight(this.code, Prism.languages[this.prismLang], this.prismLang);
 		}
 	}
 });
-- 
cgit v1.2.3-freya

