Commit 8136598
fix: drop CrossrefProcessor that corrupts URL fragments in docstrings (#83)
pydoc-markdown's `CrossrefProcessor` is run with `resolver=None` in
`generate_ast.py`, so it can never resolve a `#ref` into a real link —
it only falls back to wrapping the ref in backticks. Its regex
`\B#([\w\d._]+)` also matches any `#word` preceded by a non-word char,
so URL fragments like
`.../dockerfile_best-practices/#leverage-build-cache` (the `/#`
sequence) get corrupted into broken links such as
``...best-practices/`leverage`-build-cache``.
The Apify docstrings don't use `#ref` cross-references, so this drops
`CrossrefProcessor` from the processor list — it brought no benefit
(never produced links) and only corrupted fragments. This also matches
the griffe-based extractor, which doesn't run it either.
Verified by running the patched `generate_ast.py` against
apify-client-python: the generated AST now contains
`#leverage-build-cache` intact.
---------
Co-authored-by: Jindřich Bär <jindrichbar@gmail.com>1 parent ca1da39 commit 8136598
1 file changed
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | | - | |
53 | 50 | | |
54 | | - | |
| 51 | + | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
0 commit comments