]> git.ipfire.org Git - thirdparty/systemd.git/commit
man: handle leading/trailing/repeating whitespaces in anchor links (#39423)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Oct 2025 06:28:54 +0000 (15:28 +0900)
committerGitHub <noreply@github.com>
Tue, 28 Oct 2025 06:28:54 +0000 (15:28 +0900)
commit16e52afad2a7b4e7cc17fc2713429a65bdf82f91
tree7ceea25af393c4a38a6cb26521615b3334166056
parentbdbd9026065c8d53cc5393b40cca49eb36d28325
parent3b4b3b8a953a79ed6612e2bc013a47dbd5eaa72f
man: handle leading/trailing/repeating whitespaces in anchor links (#39423)

So even if a <term> section contains newlines, we get a reasonable
anchor link to it.

Before:
```
<dt id="
  bind
  UNIT
  PATH
  [PATH]
"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20[PATH]%0A%20%20%20%20%20%20%20%20%20%20">¶</a>
```

After:
```
<dt id="bind UNIT PATH [PATH]"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#bind%20UNIT%20PATH%20[PATH]">¶</a>
```

Resolves: https://github.com/systemd/systemd/issues/39196

---

The reverts are not strictly necessary here (as already pointed out in
https://github.com/systemd/systemd/pull/39154#issuecomment-3360118164)
but they were helpful in checking if the fix works as expected. I can
drop them if needed.