fix: Fix outline modules spilling inner doc injections into their parent

This commit is contained in:
Lukas Wirth 2022-01-08 14:54:31 +01:00
parent 47591f0fb2
commit b32f611b6e
3 changed files with 40 additions and 5 deletions

View file

@ -641,11 +641,14 @@ fn main() {
fn test_highlight_doc_comment() {
check_highlighting(
r#"
//- /main.rs
//! This is a module to test doc injection.
//! ```
//! fn test() {}
//! ```
mod outline_module;
/// ```
/// let _ = "early doctests should not go boom";
/// ```
@ -771,6 +774,13 @@ pub fn block_comments() {}
[`block_comments`] tests these without indentation
*/
pub fn block_comments2() {}
//- /outline_module.rs
//! This is an outline module whose purpose is to test that its inline attribute injection does not
//! spill into its parent.
//! ```
//! fn test() {}
//! ```
"#
.trim(),
expect_file!["./test_data/highlight_doctest.html"],