@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.
@@ -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 rawHtml = element.outerHTML;
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auto-wiz/dom",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "license": "MIT",
5
5
  "author": "JaeSang",
6
6
  "repository": {