hwhitespace
This commit is contained in:
parent
e38e8d4f1e
commit
3eac0a27a5
|
|
@ -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}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user