diff --git a/src/oj/learn/components/ExerciseFill.vue b/src/oj/learn/components/ExerciseFill.vue index 15fceae..8eea7a2 100644 --- a/src/oj/learn/components/ExerciseFill.vue +++ b/src/oj/learn/components/ExerciseFill.vue @@ -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.replace(//g, '>')}`, - ) -} const data = computed(() => props.exercise.data as ExerciseFillData) type CodeSeg = { type: "code"; html: string } @@ -101,7 +94,7 @@ function inputWidth(idx: number): string { > -

+

{{ data.question }}

()
-
-function renderInlineCode(s: string): string {
-  return s.replace(
-    /`([^`]+)`/g,
-    (_, code) => `${code.replace(//g, '>')}`,
-  )
-}
 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" {
       
     
 
-    

+

{{ data.question }}

- + {{ opt }} diff --git a/src/oj/learn/components/ExerciseSort.vue b/src/oj/learn/components/ExerciseSort.vue index 2da364f..eaf2697 100644 --- a/src/oj/learn/components/ExerciseSort.vue +++ b/src/oj/learn/components/ExerciseSort.vue @@ -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.replace(//g, '>')}`, - ) -} const data = computed(() => props.exercise.data as ExerciseSortData) type LineItem = { originalIdx: number; text: string } @@ -117,7 +110,7 @@ const lineHtmlMap = computed>(() => { > -

+

{{ data.question }}