Commit a6e76a7
Let SWUP handle in-doc links that carry a fragment
a66397f restricted SWUP's linkSelector to `[href$=".html"]` so that links to
non-HTML files (downloads such as `.mmd`) would no longer be routed through
SWUP and break the page swap (elixir-lang#2182). But `$=` matches only hrefs that *end*
in `.html`, which also excluded in-doc anchored links -- function references
like `Foo.html#fun/1` and the sidebar's per-function entries -- dropping them
back to a full page reload.
Match `.html` whether or not a fragment follows, via
`:is([href$=".html"], [href*=".html#"])`. Non-HTML files stay excluded, so
this keeps elixir-lang#2182 fixed while restoring smooth navigation for anchored links.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 09595e9 commit a6e76a7
3 files changed
Lines changed: 37 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
53 | | - | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
24 | 42 | | |
0 commit comments