Skip to content

Commit

Permalink
ignore katex parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
zema1 committed Aug 8, 2018
1 parent e1c0e9b commit 431ab19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/pages/admin/views/problem/Problem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@
</Accordion>
</el-form-item>
</div>
<el-form-item style="margin-top: 20px" :label="$t('m.Hint')">
<Simditor v-model="problem.hint" placeholder=""></Simditor>
</el-form-item>
<div class="add-sample-btn">
<button type="button" class="add-samples" @click="addSample()"><i class="el-icon-plus"></i>{{$t('m.Add_Sample')}}
</button>
Expand Down Expand Up @@ -222,9 +225,7 @@
</el-table>
</el-col>
</el-row>
<el-form-item style="margin-top: 20px" :label="$t('m.Hint')">
<Simditor v-model="problem.hint" placeholder=""></Simditor>
</el-form-item>

<el-form-item :label="$t('m.Source')">
<el-input :placeholder="$t('m.Source')" v-model="problem.source"></el-input>
</el-form-item>
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/katex.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import 'katex'
import renderMathInElement from 'katex/contrib/auto-render/auto-render'
import 'katex/dist/katex.min.css'

function _ () {
}

const defaultOptions = {
errorCallback: null,
errorCallback: _,
throwOnError: false,
delimiters: [
{left: '$', right: '$', display: false},
{left: '$$', right: '$$', display: true},
Expand All @@ -18,7 +22,6 @@ function render (el, binding) {
options = binding.value.options || {}
}
Object.assign(options, defaultOptions)
console.log(el, options)
renderMathInElement(el, options)
}

Expand Down

0 comments on commit 431ab19

Please sign in to comment.