Skip to content

Commit 2ce9bb8

Browse files
chao5goclaude
andcommitted
fix: 修复 generateGitignore 函数中的换行符语法错误
使用 \n 转义字符替代实际的换行符,避免 JavaScript 语法错误。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4bfb768 commit 2ce9bb8

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

tools/gitignore-generator/app.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ <h1>Gitignore 生成器</h1>
185185
function generateGitignore() {
186186
const selected = Array.from(document.querySelectorAll('.checkbox-group input:checked'))
187187
.map(input => input.value);
188-
const output = selected.map(key => `# ${key}
189-
` + GITIGNORE_TEMPLATES[key]).join('
190-
');
188+
const output = selected.map(key => `# ${key}\n` + GITIGNORE_TEMPLATES[key]).join('\n\n');
191189
document.getElementById('gitignore-output').value = output.trim();
192190
}
193191

0 commit comments

Comments
 (0)