Correctly handle comments in attributes in doctests source code

(cherry picked from commit de16ed35a3)
This commit is contained in:
Guillaume Gomez 2024-12-13 16:19:34 +01:00 committed by Josh Stone
parent bee5d0996b
commit 31236a39f8

View file

@ -520,6 +520,8 @@ fn handle_attr(mod_attr_pending: &mut String, source_info: &mut SourceInfo, edit
mod_attr_pending.clear();
} else if mod_attr_pending.ends_with('\\') {
mod_attr_pending.push('n');
} else {
mod_attr_pending.push_str("\n");
}
}