diff --git a/web-ui/html/detective-app.html b/web-ui/html/detective-app.html index b508bdb..e438434 100644 --- a/web-ui/html/detective-app.html +++ b/web-ui/html/detective-app.html @@ -929,10 +929,27 @@ function onPriChange(){ function onNotesChange(){/* auto-save on blur */} // 메모에 마크다운 표가 있으면, 편집 중이 아닐 때 표를 렌더링해서 보여준다(클릭하면 다시 편집). // 저장되는 값은 항상 textarea의 원문 그대로다. 표가 없는 메모는 지금처럼 textarea만 쓴다. +// 웹/엑셀에서 표를 복사하면 탭으로 구분된 줄이 붙는다. 탭이 든 줄이 2줄 이상 연속이면 첫 줄을 머리글로 한 +// 마크다운 표로 바꿔서 보여준다(표시용 변환일 뿐, 저장된 원문은 그대로). +function notesTabsToMd(raw){ + const lines=raw.split('\n'),out=[]; + const isTab=l=>l.replace(/^[\t ]+|[\t ]+$/g,'').includes('\t'); + const row=l=>'| '+l.replace(/^[\t ]+|[\t ]+$/g,'').split('\t').map(c=>c.trim().replace(/\|/g,'\\|')).join(' | ')+' |'; + for(let i=0;i=2){ + const n=lines[i].replace(/^[\t ]+|[\t ]+$/g,'').split('\t').length; + out.push(row(lines[i]),'|'+Array(n).fill('---').join('|')+'|'); + for(let k=i+1;k/g,'>');