hwhitespace

This commit is contained in:
Chris Wanstrath 2025-11-25 11:30:27 -08:00
parent 109c7ff9f6
commit 1b80a159c5
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 { } else {
// Only strip quotes from whole String nodes (legacy DoubleQuote), not StringFragment/EscapeSeq/CurlyString // Only strip quotes from whole String nodes (legacy DoubleQuote), not StringFragment/EscapeSeq/CurlyString
const cleanText = nodeName === 'String' ? text.slice(1, -1) : text const cleanText = nodeName === 'String' ? text.slice(1, -1) : text
return `${indent}${nodeName} ${cleanText}` return cleanText ? `${indent}${nodeName} ${cleanText}` : `${indent}${nodeName}`
} }
} }