fix(scrape): replace regex with DOM API to avoid template literal escape crash
This commit is contained in:
@@ -257,9 +257,11 @@ class CDPClient {
|
||||
|
||||
// leading-relaxed select-text → 마크다운 렌더링 텍스트
|
||||
const mkEl = block.querySelector('.leading-relaxed.select-text');
|
||||
let htmlContent = mkEl ? mkEl.innerHTML : block.innerHTML;
|
||||
// HTML에서도 style 태그 제거
|
||||
htmlContent = htmlContent.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, '');
|
||||
// HTML에서도 style 태그를 DOM으로 제거
|
||||
const htmlSrc = mkEl || block;
|
||||
const htmlClone = htmlSrc.cloneNode(true);
|
||||
htmlClone.querySelectorAll('style').forEach(s => s.remove());
|
||||
const htmlContent = htmlClone.innerHTML;
|
||||
|
||||
messages.push({
|
||||
type: 'text',
|
||||
|
||||
Reference in New Issue
Block a user