textContent
How text-node whitespace is handled.
| Type | "collapse" | "maintain" | "prettify" |
| Default | "maintain" |
Values
"collapse"
Collapse runs of whitespace into single spaces, trim lines, skip blanks:
<!-- input -->
<svg>
<text> hello world </text>
</svg>
<!-- output -->
<svg>
<text>
hello world
</text>
</svg>
"maintain" (default)
Preserve content structure — dedent then re-indent to SVG depth:
<!-- input -->
<svg>
<text>
hello
world
</text>
</svg>
<!-- output — relative indentation preserved -->
<svg>
<text>
hello
world
</text>
</svg>
"prettify"
Trim each line, remove blank lines, re-indent to SVG depth:
<!-- input -->
<svg>
<text>
hello
world
</text>
</svg>
<!-- output — all lines at same depth -->
<svg>
<text>
hello
world
</text>
</svg>
Config
{
"svg": {
"textContent": "maintain"
}
}