diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/markdown.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/markdown.rs b/crates/ra_lsp_server/src/markdown.rs index 947ef77cd..c1eb0236a 100644 --- a/crates/ra_lsp_server/src/markdown.rs +++ b/crates/ra_lsp_server/src/markdown.rs | |||
@@ -54,4 +54,21 @@ mod tests { | |||
54 | let comment = "this\nis\nultiline"; | 54 | let comment = "this\nis\nultiline"; |
55 | assert_eq!(format_docs(comment), comment); | 55 | assert_eq!(format_docs(comment), comment); |
56 | } | 56 | } |
57 | |||
58 | #[test] | ||
59 | fn test_code_blocks_in_comments_marked_as_rust() { | ||
60 | let comment = r#"```rust | ||
61 | fn main(){} | ||
62 | ``` | ||
63 | Some comment. | ||
64 | ``` | ||
65 | let a = 1; | ||
66 | ```"#; | ||
67 | |||
68 | assert_eq!( | ||
69 | format_docs(comment), | ||
70 | "```rust\nfn main(){}\n```\nSome comment.\n```rust\nlet a = 1;\n```" | ||
71 | ); | ||
72 | } | ||
73 | |||
57 | } | 74 | } |