fix: [cc-to-slack] 슬랙 미리보기 편집 가능 + 번호 목록 줄바꿈 분리
- 미리보기 영역에 contenteditable 속성 추가 (편집 가능) - 번호 목록(1. 2. 3.)이 한 줄에 이어진 경우 자동 줄바꿈 분리 - 편집 시 포커스 시각 표시(보라색 아웃라인) 추가
This commit is contained in:
@@ -91,6 +91,7 @@
|
||||
}
|
||||
.cs-preview .slack-link { color: #1d9bd1; text-decoration: none; }
|
||||
.cs-preview .slack-hr { border: none; border-top: 1px solid #3c3f44; margin: 8px 0; }
|
||||
.cs-preview:focus { outline: 1px solid var(--cs-purple); outline-offset: -1px; }
|
||||
|
||||
.cs-status {
|
||||
display: flex; align-items: center; padding: 6px 16px;
|
||||
@@ -136,7 +137,7 @@
|
||||
<button class="cs-btn success" onclick="copyPreview()"><i class="fas fa-copy"></i> 복사</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="previewArea" class="cs-preview">
|
||||
<div id="previewArea" class="cs-preview" contenteditable="true">
|
||||
<div style="color:var(--cs-text2); padding:40px 20px; text-align:center;">
|
||||
<i class="fas fa-arrow-left" style="font-size:24px; margin-bottom:12px; display:block;"></i>
|
||||
왼쪽에 Claude Code 출력을 붙여넣으면<br>슬랙에 바로 붙여넣을 수 있는 형태로 변환됩니다
|
||||
@@ -165,6 +166,10 @@
|
||||
function convertToSlack(text) {
|
||||
if (!text.trim()) return '';
|
||||
|
||||
// 번호 목록이 한 줄에 이어진 경우 줄바꿈으로 분리
|
||||
// e.g., "내용 1. 항목 2. 항목" → "내용\n1. 항목\n2. 항목"
|
||||
text = text.replace(/([^\d\n])\s+(\d{1,2})\.\s/g, '$1\n$2. ');
|
||||
|
||||
let lines = text.split('\n');
|
||||
let result = [];
|
||||
let inCodeBlock = false;
|
||||
|
||||
Reference in New Issue
Block a user