We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 284c174 + be17eab commit a869ca3Copy full SHA for a869ca3
crates/rust-analyzer/src/markdown.rs
@@ -28,7 +28,7 @@ pub(crate) fn format_docs(src: &str) -> String {
28
29
if in_code_block {
30
let trimmed = line.trim_start();
31
- if trimmed.starts_with("##") {
+ if is_rust && trimmed.starts_with("##") {
32
line = &trimmed[1..];
33
}
34
@@ -154,4 +154,12 @@ let s = "foo
154
155
assert_eq!(format_docs(comment), "```rust\nlet s = \"foo\n# bar # baz\";\n```");
156
157
+
158
+ #[test]
159
+ fn test_format_docs_handles_double_hashes_non_rust() {
160
+ let comment = r#"```markdown
161
+## A second-level heading
162
+```"#;
163
+ assert_eq!(format_docs(comment), "```markdown\n## A second-level heading\n```");
164
+ }
165
0 commit comments