@auto-wiz/dom 1.0.1 → 1.0.2
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/steps/stepExecution.js +17 -2
- package/package.json +1 -1
|
@@ -191,8 +191,23 @@ export async function executeExtractStep(step) {
|
|
|
191
191
|
extractedData = element.textContent?.trim() || "";
|
|
192
192
|
}
|
|
193
193
|
else if (prop === "outerHTML") {
|
|
194
|
-
// XML 구조를 보기 좋게
|
|
195
|
-
const
|
|
194
|
+
// XML 구조를 보기 좋게 포맷팅하기 전에 base64 이미지 제거
|
|
195
|
+
const cloned = element.cloneNode(true);
|
|
196
|
+
const processImage = (img) => {
|
|
197
|
+
const src = img.getAttribute("src");
|
|
198
|
+
if (src && src.startsWith("data:image")) {
|
|
199
|
+
img.removeAttribute("src");
|
|
200
|
+
img.setAttribute("data-image-removed", "true");
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
if (cloned.tagName.toLowerCase() === "img") {
|
|
204
|
+
processImage(cloned);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
const images = cloned.querySelectorAll("img");
|
|
208
|
+
images.forEach((img) => processImage(img));
|
|
209
|
+
}
|
|
210
|
+
const rawHtml = cloned.outerHTML;
|
|
196
211
|
extractedData = formatXml(rawHtml);
|
|
197
212
|
}
|
|
198
213
|
else {
|