diff options
author | Li Jin <dragon-fly@qq.com> | 2022-11-23 17:18:42 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-11-23 17:18:42 +0800 |
commit | c2471402e419f3128d76ab71232958c83b80c94f (patch) | |
tree | a7bbc9a9559aceb615143480f135adfbf6496cac /doc | |
parent | 8d36b240cd0800bd5584d52cb5d19d0ae5371357 (diff) | |
download | yuescript-c2471402e419f3128d76ab71232958c83b80c94f.tar.gz yuescript-c2471402e419f3128d76ab71232958c83b80c94f.tar.bz2 yuescript-c2471402e419f3128d76ab71232958c83b80c94f.zip |
fix doc site Lua code highlight.
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/docs/.vuepress/components/YueCompiler.vue | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/docs/.vuepress/components/YueCompiler.vue b/doc/docs/.vuepress/components/YueCompiler.vue index ea8ea11..86d7566 100755 --- a/doc/docs/.vuepress/components/YueCompiler.vue +++ b/doc/docs/.vuepress/components/YueCompiler.vue | |||
@@ -9,12 +9,12 @@ | |||
9 | </div> | 9 | </div> |
10 | <div class="childL" ref='yueEditor' style="height: 30em;"> | 10 | <div class="childL" ref='yueEditor' style="height: 30em;"> |
11 | <ClientOnly> | 11 | <ClientOnly> |
12 | <prism-editor class="my-editor" v-model="code" :highlight="highlighter" @input="codeChanged($event)" line-numbers :readonly="readonly"></prism-editor> | 12 | <prism-editor class="my-editor" v-model="code" :highlight="highlighterYue" @input="codeChanged($event)" line-numbers :readonly="readonly"></prism-editor> |
13 | </ClientOnly> | 13 | </ClientOnly> |
14 | </div> | 14 | </div> |
15 | <div class="childR" style="height: 30em;"> | 15 | <div class="childR" style="height: 30em;"> |
16 | <ClientOnly> | 16 | <ClientOnly> |
17 | <prism-editor class="my-editor" v-model="compiled" :highlight="highlighter" @input="codeChanged($event)" readonly></prism-editor> | 17 | <prism-editor class="my-editor" v-model="compiled" :highlight="highlighterLua" @input="codeChanged($event)" readonly></prism-editor> |
18 | </ClientOnly> | 18 | </ClientOnly> |
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
@@ -98,9 +98,12 @@ | |||
98 | this.$data.result = res; | 98 | this.$data.result = res; |
99 | } | 99 | } |
100 | }, | 100 | }, |
101 | highlighter(code) { | 101 | highlighterYue(code) { |
102 | return highlight(code, languages.moon); | 102 | return highlight(code, languages.moon); |
103 | }, | 103 | }, |
104 | highlighterLua(code) { | ||
105 | return highlight(code, languages.lua); | ||
106 | }, | ||
104 | codeChanged(text) { | 107 | codeChanged(text) { |
105 | if (window.yue) { | 108 | if (window.yue) { |
106 | let res = ['','compiler error, and please help opening an issue for this. Thanks a lot!']; | 109 | let res = ['','compiler error, and please help opening an issue for this. Thanks a lot!']; |