PronounsPage/components/Spelling.vue
2021-11-21 17:38:20 +01:00

22 lines
568 B
Vue

<script>
import spelling from "../plugins/spelling";
import { escapeHtml } from '../src/helpers';
export default {
mixins: [ spelling ],
props: {
text: { required: true },
escape: { type: Boolean }
},
render(h) {
let text = this.text || '';
text = text.replace('<script', '');
if (this.escape) {
text = escapeHtml(text);
}
return h('span', {domProps: { innerHTML: this.handleSpelling(text) }});
},
}
</script>