Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: work around Pandoc 3.2+ breaking links to chapters (#100)
Pandoc used to wrap the contents of each file in a div when `--file-scope` was used, which `mdbook-pandoc` relied on to link to the start of a chapter. This behavior was removed in jgm/pandoc@30442b7, which was released in version 3.2. To work around this, `mdbook-pandoc` now searches for the first heading in each chapter and, if present, links to this heading as a proxy for the beginning of the chapter. This should make sense in most cases, since mdBook chapters tend to start with a top-level heading, but will result in regressions if chapters don't contain any headings or the headings they do contain don't have a usable identifier (this is the case with [punctuation-only headings](https://doc.rust-lang.org/rust-by-example/std/result/question_mark.html), for instance). See the [Pandoc manual](https://pandoc.org/MANUAL.html#extension-gfm_auto_identifiers) for the algorithm used to generate identifiers for headings. Closes #99
- Loading branch information