Skip to content

Commit

Permalink
Fix for weird blank line error
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Aug 16, 2021
1 parent 5631897 commit 625b898
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion resources/js/components/RichTextEditor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<VueEditor class="editor" v-model="value" :editor-options="editorOptions" />
<input type="hidden" v-model="value" :name="name" />
<input type="hidden" v-model="valueCorrected" :name="name" />
</div>
</template>
<script>
Expand Down Expand Up @@ -32,6 +32,7 @@ export default {
data: function() {
return {
value: null,
valueCorrected: null,
editorOptions: {
modules: {
htmlEditButton: {},
Expand All @@ -58,8 +59,21 @@ export default {
}
}
},
watch: {
value(newVal) {
console.log("Correct", newVal)
// We have an odd problem on Linux where we get <p><br>.
if (newVal) {
newVal = newVal.replace('<p><br>', '<p>');
console.log("Corrected", newVal)
}
this.valueCorrected = newVal
}
},
mounted() {
this.value = this.initialValue
this.valueCorrected = this.initialValue
},
methods: {
}
Expand Down

0 comments on commit 625b898

Please sign in to comment.