|
@@ -227,10 +227,9 @@ const EditorComp = defineComponent({
|
|
const tagReg =
|
|
const tagReg =
|
|
/(<(p|h2|h3)[\s\S]*?>)(<span[\s\S]*?>)?([\s\S]*?)(<\/span>)?(<\/(p|h2|h3)>)/gi;
|
|
/(<(p|h2|h3)[\s\S]*?>)(<span[\s\S]*?>)?([\s\S]*?)(<\/span>)?(<\/(p|h2|h3)>)/gi;
|
|
const blocks = comp.value.text.match(tagReg);
|
|
const blocks = comp.value.text.match(tagReg);
|
|
- if (!blocks) {
|
|
|
|
- return;
|
|
|
|
|
|
+ if (blocks) {
|
|
|
|
+ preTag.value = blocks[0];
|
|
}
|
|
}
|
|
- preTag.value = blocks[0];
|
|
|
|
}
|
|
}
|
|
if (!comp.value.text && preTag.value) {
|
|
if (!comp.value.text && preTag.value) {
|
|
const text = value?.replace(/<[^>]+>/g, "");
|
|
const text = value?.replace(/<[^>]+>/g, "");
|