hwhitespace

This commit is contained in:
Chris Wanstrath 2025-11-25 11:30:27 -08:00 committed by Chris Wanstrath
parent e38e8d4f1e
commit 3eac0a27a5
4 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@ const nodeToString = (node: SyntaxNode, input: string, depth = 0): string => {
} else {
// Only strip quotes from whole String nodes (legacy DoubleQuote), not StringFragment/EscapeSeq/CurlyString
const cleanText = nodeName === 'String' ? text.slice(1, -1) : text
return `${indent}${nodeName} ${cleanText}`
return cleanText ? `${indent}${nodeName} ${cleanText}` : `${indent}${nodeName}`
}
}