[formatter] add 'W' conversion - sanitize whitespace (#6582)

https://github.com/mikf/gallery-dl/issues/6582#issuecomment-3090777073
This commit is contained in:
Mike Fährmann
2025-07-19 21:44:55 +02:00
parent 7bb4053396
commit 240f958707
3 changed files with 13 additions and 2 deletions

View File

@@ -128,6 +128,12 @@ Conversion specifiers allow to *convert* the value to a different form or type.
<td><code>{foo!n}</code></td>
<td><code>7</code></td>
</tr>
<tr>
<td align="center"><code>W</code></td>
<td>Sanitize whitespace - Remove leading and trailing whitespace characters and replace <em>all</em> whitespace (sequences) with a single space <code> </code> character</td>
<td><code>{space!W}</code></td>
<td><code>Foo Bar</code></td>
</tr>
<tr>
<td align="center"><code>t</code></td>
<td>Trim a string, i.e. remove leading and trailing whitespace characters</td>