-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: A bug, incorrect or unintended behaviorCategory: A bug, incorrect or unintended behavior
Description
Problem
The example code in https://rust-lang.github.io/mdBook/for_developers/preprocessors.html#hints-for-implementing-a-preprocessor doesn't actually work:
cmark(events, &mut buf, None).map(|_| buf).map_err(|err| {
That function (from https://docs.rs/pulldown-cmark-to-cmark/latest/pulldown_cmark_to_cmark/fn.cmark.html) only takes two arguments. I went back a few major versions and it still only took two arguments. So presumably it is just extremely outdated (or outright broken). (I have yet to figure out how to properly use the API, so I don't have a specific suggested fix at this point).
Steps
- Read docs on writing your own pre-processor.
- Try to use the example as a starting point.
Possible Solution(s)
- The code should be updated to work.
- The code should be tested by CI to ensure that it works. Possibly the easiest way to do this is to move it to the nop-example in repo instead.
Notes
No response
Version
mdbook v0.4.40
pulldown-cmark 0.12.2
pulldown-cmark-to-cmark 18.0.0
Metadata
Metadata
Assignees
Labels
C-bugCategory: A bug, incorrect or unintended behaviorCategory: A bug, incorrect or unintended behavior