Commit 24f9dd5
committed
website,book: fix link rewriting that mangled external URLs
filter.py rewrote cross-chapter links with the loose regex (./)(.*?)(.md),
whose unescaped dots matched any ':/ … md' span — so a chapter line with an
external URL like '#cmdoption-…' got corrupted into 'https..//…' on the
built site. Anchor the rewrite to the ](./NN-name.md) link syntax with a
simple filename so external URLs are never touched; chapter cross-links and
#anchors still resolve.
Also repoint the preface Code/Exercises links at the GitHub tree (they were
relative dir links that 404 on the static site — no directory index — and
the English one had an 'exercise' typo); GitHub URLs work on the site, on
GitHub, and in the PDF.1 parent bf50489 commit 24f9dd5
3 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments