Write preprocessed content to file before testing with rustdoc#891
Merged
ehuss merged 1 commit intorust-lang:masterfrom Jun 12, 2019
Merged
Write preprocessed content to file before testing with rustdoc#891ehuss merged 1 commit intorust-lang:masterfrom
ehuss merged 1 commit intorust-lang:masterfrom
Conversation
b8fffc8 to
d7c7d91
Compare
Member
Author
|
Wooo ok it passed! I was second guessing myself about the tests after submitting this, so in case anyone has the same thoughts I did: it would appear that the The |
11 tasks
ehuss
approved these changes
Apr 22, 2019
This was referenced May 7, 2019
Contributor
|
Thanks! Sorry I lost track of this. |
Ruin0x11
pushed a commit
to Ruin0x11/mdBook
that referenced
this pull request
Aug 30, 2020
Write preprocessed content to file before testing with rustdoc
ehuss
added a commit
to ehuss/mdBook
that referenced
this pull request
Dec 10, 2025
This fixes a problem where custom preprocessors were not being registered when running tests. This was caused by the test function rebuilding the preprocessor map. This removes the code that was rebuilding the preprocessors and removing the IndexPreprocessor when running tests. Skipping IndexPreprocessor was added back in rust-lang#741 to fix rust-lang#724 which was caused by rust-lang#685 which added the IndexPreprocessor. Additionally, rust-lang#1986 added running *all* preprocessors. The IndexPreprocessor was removed because in the past the code was testing against the source directly, and the path from `chapter.path` is the converted `index.md` file, and that filename does not exist in the source. This isn't a problem anymore because due to rust-lang#891 it is not reading from the `src` directory. Note that this results in a minor change where the chapter path changes from `README.md` to `index.md` in the output and the `--chapter` option. I think I'm ok with that change, though it would be easy to switch it back if that's an issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than writing the unpreprocessed content to the file for rustdoc to test with.
Fixes #855.
I was trying to figure out whether the current behavior was intentional or not, and if I might be breaking anything with this change, but I think the fix I have here is what was intended-- my first hint was this comment that described what I had hoped was happening but that wasn't what was actually happening.
As of this commit, it seems like the behavior I was hoping for was happening and was intended ("now
mdbook testdoes full link expansion to temp file prior to running" in the commit message), but this line got lost in refactoring and the preprocessors were being run but this line read the unprocessed file from disk again and gave that content to rustdoc :(If this fails CI I will fix it tomorrow ❤️