revert
This commit is contained in:
@@ -8,13 +8,6 @@ hljs.registerLanguage("python", python)
|
||||
hljs.registerLanguage("c", c)
|
||||
|
||||
const props = defineProps<{ exercise: Exercise; lang?: string }>()
|
||||
|
||||
function renderInlineCode(s: string): string {
|
||||
return s.replace(
|
||||
/`([^`]+)`/g,
|
||||
(_, code) => `<code style="background:rgba(127,127,127,0.12);padding:2px 6px;border-radius:4px;font-family:Monaco,monospace;font-size:14px">${code.replace(/</g, '<').replace(/>/g, '>')}</code>`,
|
||||
)
|
||||
}
|
||||
const data = computed(() => props.exercise.data as ExerciseFillData)
|
||||
|
||||
type CodeSeg = { type: "code"; html: string }
|
||||
@@ -101,7 +94,7 @@ function inputWidth(idx: number): string {
|
||||
>
|
||||
</template>
|
||||
|
||||
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px" v-html="renderInlineCode(data.question)" />
|
||||
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px">{{ data.question }}</p>
|
||||
|
||||
<pre
|
||||
:style="{
|
||||
|
||||
@@ -2,13 +2,6 @@
|
||||
import { Exercise, ExerciseMcqData } from "utils/types"
|
||||
|
||||
const props = defineProps<{ exercise: Exercise }>()
|
||||
|
||||
function renderInlineCode(s: string): string {
|
||||
return s.replace(
|
||||
/`([^`]+)`/g,
|
||||
(_, code) => `<code style="background:rgba(127,127,127,0.12);padding:2px 6px;border-radius:4px;font-family:Monaco,monospace;font-size:14px">${code.replace(/</g, '<').replace(/>/g, '>')}</code>`,
|
||||
)
|
||||
}
|
||||
const data = computed(() => props.exercise.data as ExerciseMcqData)
|
||||
const isSingle = computed(() => data.value.answer.length === 1)
|
||||
|
||||
@@ -81,7 +74,7 @@ function optionType(idx: number): "default" | "primary" | "success" {
|
||||
</n-space>
|
||||
</template>
|
||||
|
||||
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px" v-html="renderInlineCode(data.question)" />
|
||||
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px">{{ data.question }}</p>
|
||||
|
||||
<n-space vertical :size="8">
|
||||
<n-button
|
||||
@@ -103,7 +96,7 @@ function optionType(idx: number): "default" | "primary" | "success" {
|
||||
String.fromCharCode(65 + idx)
|
||||
}}</span>
|
||||
</template>
|
||||
<span v-html="renderInlineCode(opt)" />
|
||||
{{ opt }}
|
||||
</n-button>
|
||||
</n-space>
|
||||
|
||||
|
||||
@@ -8,13 +8,6 @@ hljs.registerLanguage("python", python)
|
||||
hljs.registerLanguage("c", c)
|
||||
|
||||
const props = defineProps<{ exercise: Exercise; lang?: string }>()
|
||||
|
||||
function renderInlineCode(s: string): string {
|
||||
return s.replace(
|
||||
/`([^`]+)`/g,
|
||||
(_, code) => `<code style="background:rgba(127,127,127,0.12);padding:2px 6px;border-radius:4px;font-family:Monaco,monospace;font-size:14px">${code.replace(/</g, '<').replace(/>/g, '>')}</code>`,
|
||||
)
|
||||
}
|
||||
const data = computed(() => props.exercise.data as ExerciseSortData)
|
||||
|
||||
type LineItem = { originalIdx: number; text: string }
|
||||
@@ -117,7 +110,7 @@ const lineHtmlMap = computed<Record<number, string>>(() => {
|
||||
>
|
||||
</template>
|
||||
|
||||
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px" v-html="renderInlineCode(data.question)" />
|
||||
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px">{{ data.question }}</p>
|
||||
|
||||
<n-space vertical :size="6">
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user