diff --git a/web-ui/html/detective-app.html b/web-ui/html/detective-app.html index 334b3fd..3ea9c83 100644 --- a/web-ui/html/detective-app.html +++ b/web-ui/html/detective-app.html @@ -966,10 +966,36 @@ function notesTabsToMd(raw){ function notesRender(raw){ const esc=t=>t.replace(/&/g,'&').replace(//g,'>'); const inl=t=>t.replace(/`([^`]+)`/g,'$1').replace(/\*\*(.+?)\*\*/g,'$1') - .replace(/(https?:\/\/[^\s<)]+)/g,'$1'); + .replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'$1') + .replace(/(^|[^"=>])(https?:\/\/[^\s<)]+)/g,'$1$2'); const indentOf=l=>{let n=0;for(const ch of l){if(ch==='\t')n+=4;else if(ch===' ')n++;else break;}return n;}; - const LI=/^(\s*)([-*•·▪‣◦○●■□→]|\d+[.)]|\(\d+\)|[가-힣][.)])\s+(.*)$/; - const lines=notesTabsToMd(raw).split('\n'); + const LI=/^(\s*)([-*•·▪‣◦○●■□→]|\d{1,2}[.)]|\(\d{1,2}\)|[가-힣][.)])\s+(.*)$/; + // 한 줄로 뭉쳐 붙여넣은 번호 목록("1. … 2. … 3. …")을 항목별로 나누고, "항목: - 내용"은 하위 항목으로 내린다. + // 번호가 1,2,3처럼 이어질 때만 나눠서 날짜(2026. 3. 5.) 같은 건 건드리지 않는다. + const expand=arr=>{ + const merged=[]; + for(let k=0;k0&&ln.slice(0,seq[0].at).trim())res.push(ln.slice(0,seq[0].at).trim()); + seq.forEach((h,k)=>{ + const piece=ln.slice(h.at,k+11){res.push(parts[0]+':');for(const sub of parts.slice(1))res.push(' - '+sub.trim());} + else res.push(piece); + }); + } + return res; + }; + const lines=expand(notesTabsToMd(raw).split('\n')); const out=[];let i=0,para=null; const flush=()=>{if(para){out.push('
'+para.join('
')+'
');para=null;}}; const pushText=(html,rawLine)=>{