dragon-editor 2.0.0-beta.2.1 → 2.0.0-beta.2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -49,16 +49,41 @@ function updateBlockData() {
|
|
|
49
49
|
|
|
50
50
|
// 커서위치 재지정
|
|
51
51
|
if ($block.value.innerHTML.length > 0) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
if (props.cursorData.endOffset !== null) {
|
|
53
|
+
const cursorData = getArrangementCursorData(props.cursorData);
|
|
54
|
+
|
|
55
|
+
data.value.content = $block.value.innerHTML;
|
|
56
|
+
emit("update:modelValue", data.value);
|
|
57
|
+
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
if ($block.value) {
|
|
60
|
+
setCursor($block.value.childNodes[cursorData.childCount], cursorData.length);
|
|
61
|
+
|
|
62
|
+
// 구조 검수
|
|
63
|
+
$block.value.childNodes.forEach((child: ChildNode) => {
|
|
64
|
+
const $child = child as HTMLElement;
|
|
65
|
+
|
|
66
|
+
if (child.constructor.name !== "Text") {
|
|
67
|
+
// 텍스트가 아닐경우
|
|
68
|
+
if (child.constructor.name !== "HTMLBRElement") {
|
|
69
|
+
// br 태그 유지
|
|
70
|
+
if (child.textContent === "") {
|
|
71
|
+
// 빈 태그 삭제
|
|
72
|
+
child.remove();
|
|
73
|
+
} else if ($child.classList.length === 0) {
|
|
74
|
+
// 클레스 없는 엘리먼트 처리
|
|
75
|
+
$child.insertAdjacentHTML("afterend", $child.innerHTML);
|
|
76
|
+
child.remove();
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
$child.removeAttribute("class");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}, 100);
|
|
85
|
+
} else {
|
|
58
86
|
if ($block.value) {
|
|
59
|
-
setCursor($block.value.childNodes[cursorData.childCount], cursorData.length);
|
|
60
|
-
|
|
61
|
-
// 구조 검수
|
|
62
87
|
$block.value.childNodes.forEach((child: ChildNode) => {
|
|
63
88
|
const $child = child as HTMLElement;
|
|
64
89
|
|
|
@@ -79,8 +104,11 @@ function updateBlockData() {
|
|
|
79
104
|
}
|
|
80
105
|
}
|
|
81
106
|
});
|
|
107
|
+
|
|
108
|
+
data.value.content = $block.value.innerHTML;
|
|
109
|
+
emit("update:modelValue", data.value);
|
|
82
110
|
}
|
|
83
|
-
}
|
|
111
|
+
}
|
|
84
112
|
} else {
|
|
85
113
|
emit("update:modelValue", data.value);
|
|
86
114
|
}
|