Commit cea98f9
committed
Modify
`README` files
Previously, the `index` preprocessor only changed the file names of
`README` to `index.md`, but did not modify internal links pointing to
said files to point to the renamed file instead. This resulted in
internal links to `README` files being broken and giving 404 errors.
This commit rectifies this by using the
`mdbook-markdown`/`pulldown-cmark` to find links within the book, and
the `url` crate to filter out internal links to `README` files, which
are then adjusted accordingly.
Fixes #984.index preprocessor to also fix internal links pointing to1 parent dc151e1 commit cea98f9
File tree
4 files changed
+416
-1
lines changed- crates/mdbook-driver
- src/builtin_preprocessors
4 files changed
+416
-1
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
0 commit comments