This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/components/Spelling.vue

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>