diff --git a/supporters/scripts/assign_post_heroes.mjs b/supporters/scripts/assign_post_heroes.mjs index 9390416..3f2ed7a 100644 --- a/supporters/scripts/assign_post_heroes.mjs +++ b/supporters/scripts/assign_post_heroes.mjs @@ -80,6 +80,9 @@ const PREF = { G: ['clinic', 'procedure', 'equipment'], }; const CATS = new Set(['procedure', 'equipment', 'clinic']); +// 수집한 alt 가 효과·결과를 주장하면 그 문장을 쓰지 않는다. 카드와 글 머리의 alt 로 나가면 +// 의료법 56조 2항 8호(객관적 사실 과장) 대상이 된다. 이미지 자체는 문제가 없으므로 +// 빼지 않고 무엇을 찍은 것인지만 밝히는 중립 문구로 바꾼다. const pool = (manifest.items ?? []) .filter((i) => CATS.has(i.category) && !shown.has(i.src) && !kept.has(i.src)) .map((i) => ({ ...i, inGallery: inGallery.has(i.src) })); @@ -88,12 +91,16 @@ if (!targets.length) { console.log(`글 ${posts.length}편 · 겹치는 대표 if (!pool.length) { console.log(`대상 ${targets.length}편이지만 쓸 수 있는 이미지가 없음 (의료진 사진은 글 히어로로 쓰지 않는다)`); process.exit(0); } // ---------- 문구 ---------- +const EFFICACY = /개선|완화|제거|재생|촉진|강화|효과|없애|줄여|늘려|맑아|밝아|탄력|안전하게|빠른\s*회복|통증\s*없/; +// 수집기의 분류를 그대로 믿지 않는다. 일러스트가 시설(clinic)로 들어오는 경우가 있어 +// 유형을 단정하는 문구 대신 출처만 밝힌다. function shortAlt(item) { const raw = String(item.alt || '').replace(/\s+/g, ' ').trim(); - if (!raw) return `${clinicName} 홈페이지 이미지`.trim(); + const fallback = [clinicName, '홈페이지 이미지'].filter(Boolean).join(' '); + if (!raw || EFFICACY.test(raw)) return fallback; let s = raw.split(/(?<=[.!?])\s|(?=\s\d\s)/)[0].replace(/\s*\d+\s*$/, '').trim(); if (s.length > 60) s = s.slice(0, 58).replace(/\s\S*$/, '') + '…'; - return s || `${clinicName} 홈페이지 이미지`.trim(); + return EFFICACY.test(s) ? fallback : (s || fallback); } function caption(item) { const t = String(item.page?.title || '').replace(/\s+/g, ' ').trim(); diff --git a/supporters/scripts/check.mjs b/supporters/scripts/check.mjs index df7fb2c..53aa90b 100644 --- a/supporters/scripts/check.mjs +++ b/supporters/scripts/check.mjs @@ -36,9 +36,14 @@ function walk(dir, out = []) { return out; } -function withoutRecoveryQuote(html) { +// 홈페이지 40자 일치 검사에서 뺄 블록. 둘 다 출처를 밝히고 병원 원문을 그대로 옮기는 자리라 설계상 일치한다. +// #recovery-quote : /stay 의 "시술 후 관리 안내" 인용(출처 링크·확인일 표시) +// .doctor-strip : 글의 검토자 표시줄. 원장 이력을 병원 의료진 페이지에서 옮기고 프로필 링크를 단다. +// 다른 말로 바꿔 쓰면 이력이 사실과 달라지므로 원문 그대로 두는 것이 맞다. +const QUOTED_BLOCKS = ['#recovery-quote', '.doctor-strip']; +function withoutQuotedBlocks(html) { const root = parseHtml(html); - root.querySelectorAll('#recovery-quote').forEach((el) => el.remove()); + for (const sel of QUOTED_BLOCKS) root.querySelectorAll(sel).forEach((el) => el.remove()); return root.toString(); } @@ -73,9 +78,11 @@ for (const f of files) { const h1 = (html.match(/