diff --git a/web-ui/html/detective-app.html b/web-ui/html/detective-app.html index 7161c53..334b3fd 100644 --- a/web-ui/html/detective-app.html +++ b/web-ui/html/detective-app.html @@ -93,12 +93,25 @@ body{background:var(--bg);color:var(--text);font-family:system-ui,sans-serif;dis .dt-notes-textarea{flex:1;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 14px;font-size:12px;color:var(--text);font-family:inherit;resize:none;outline:none;line-height:1.7;transition:.15s;} .dt-notes-textarea:focus{border-color:#3b82f6;} .dt-notes-textarea::placeholder{color:var(--muted);} -.dt-notes-view{flex:1;min-height:0;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 14px;font-size:12px;color:var(--text);line-height:1.7;white-space:pre-wrap;word-break:keep-all;overflow-wrap:anywhere;cursor:text;} +.dt-notes-view{flex:1;min-height:0;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 16px;font-size:12.5px;color:var(--text);line-height:1.75;word-break:keep-all;overflow-wrap:anywhere;cursor:text;} .dt-notes-view:hover{border-color:#3b82f6;} -.dt-notes-view table{border-collapse:collapse;font-size:11px;margin:6px 0;white-space:normal;width:100%;table-layout:auto;} +.dt-notes-view .nv-p{margin:0 0 8px;} +.dt-notes-view .nv-h{font-weight:700;margin:14px 0 6px;line-height:1.4;} +.dt-notes-view .nv-h1{font-size:16px;border-bottom:1px solid var(--line);padding-bottom:4px;} +.dt-notes-view .nv-h2{font-size:14px;color:#3b82f6;} +.dt-notes-view .nv-h3,.dt-notes-view .nv-h4{font-size:13px;} +.dt-notes-view .nv-li{display:flex;gap:7px;margin-bottom:3px;} +.dt-notes-view .nv-mk{flex:none;min-width:1.2em;text-align:right;color:var(--muted);} +.dt-notes-view .nv-kv{margin-bottom:3px;} +.dt-notes-view .nv-k{font-weight:700;color:var(--muted);margin-right:4px;} +.dt-notes-view .nv-cont{display:inline-block;margin-left:1.5em;} +.dt-notes-view .nv-q{border-left:3px solid var(--line);padding-left:10px;color:var(--muted);margin:4px 0;} +.dt-notes-view hr{border:none;border-top:1px solid var(--line);margin:12px 0;} +.dt-notes-view a{color:#3b82f6;} +.dt-notes-view table{border-collapse:collapse;font-size:11.5px;margin:8px 0;width:100%;table-layout:auto;} .dt-notes-view th,.dt-notes-view td{border:1px solid var(--line);padding:4px 8px;text-align:left;vertical-align:top;line-height:1.55;word-break:keep-all;overflow-wrap:anywhere;} -.dt-notes-view td:first-child{white-space:nowrap;} .dt-notes-view th{background:var(--panel-2);font-weight:700;} +.dt-notes-view td:first-child{white-space:nowrap;} .dt-notes-view code{background:var(--panel-2);padding:0 4px;border-radius:3px;} .dt-notes-hint{font-size:10px;color:var(--muted);margin-left:8px;font-weight:400;} @@ -377,7 +390,7 @@ body{background:var(--bg);color:var(--text);font-family:system-ui,sans-serif;dis - 확인된 사실: 2024년 법인 설립, 주소지 ○○동 - 의심 정황: SNS에서 확인되지 않은 수익 주장 - 수집 단서: 사업자등록증 번호, 전화번호 ○○○" oninput="onNotesChange()" onblur="saveCases();refreshNotesView()" onkeydown="handleNotesTab(event)"> -
+ @@ -947,29 +960,76 @@ function notesTabsToMd(raw){ } return out.join('\n'); } -// 복사해 온 글은 일정 폭에서 줄이 하드 개행돼 있어, 화면이 좁으면 둘째 줄이 짧게 남는다. -// 보기 화면에서만: 긴 줄(45자↑) 뒤에 이어지는 일반 문장 줄은 한 줄로 이어 붙여 화면 폭에 맞게 다시 흘린다. -function notesReflow(text){ - const lines=text.split('\n'),out=[]; - const special=l=>/^\s*(\||[-*•·▪]\s|\d+[.)]\s|\[|#|>|[가-힣A-Za-z0-9 ]{1,12}\s*:\s)/.test(l); - for(const l of lines){ - const prev=out.length?out[out.length-1]:null; - if(prev!==null&&prev.trim()&&l.trim()&&prev.trim().length>=45&&!special(prev)&&!special(l))out[out.length-1]=prev.replace(/\s+$/,'')+' '+l.trim(); - else out.push(l); +// 메모 보기 화면: md 문서처럼 정리해서 보여준다(표시용일 뿐, 저장된 원문은 그대로). +// 제목(#, [제목]), 목록(-, *, •, 1., 1), 가., (1)) 들여쓰기 단계, "항목 : 값", 인용(>), 구분선, 표(| 또는 탭), +// 굵게/코드/링크를 처리하고, 하드 개행된 긴 문장(45자↑)은 이어 붙여 화면 폭에 맞춘다. +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');
+ 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 out=[];let i=0,para=null;
+ const flush=()=>{if(para){out.push('$1').replace(/\*\*(.+?)\*\*/g,'$1').replace(/(<\/table><\/div>)\n/g,'$1');
+ view.innerHTML=notesRender(raw0);
ta.style.display='none';view.style.display='';
}
-function editNotes(){
+function editNotes(ev){
+ if(ev&&ev.target&&ev.target.closest&&ev.target.closest('a'))return; // 링크 클릭은 편집 전환 안 함
const ta=document.getElementById('case-notes'),view=document.getElementById('case-notes-view');
if(window.getSelection&&String(window.getSelection()))return; // 드래그 선택(복사) 중이면 편집 전환 안 함
view.style.display='none';ta.style.display='';ta.focus();