Skip to content

Commit c1db5da

Browse files
authored
Merge pull request #19030 from Veykril/push-wuzvopyooznm
fix: Fix markdown horizontal ruler sometimes being treated as a heading
2 parents 80615d9 + a5cd6c0 commit c1db5da

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/tools/rust-analyzer/crates/ide/src/hover.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ fn hover_offset(
346346
.unique()
347347
.reduce(|mut acc: HoverResult, HoverResult { markup, actions }| {
348348
acc.actions.extend(actions);
349-
acc.markup = Markup::from(format!("{}\n---\n{markup}", acc.markup));
349+
acc.markup = Markup::from(format!("{}\n\n---\n{markup}", acc.markup));
350350
acc
351351
})
352352
.map(|mut res: HoverResult| {

src/tools/rust-analyzer/crates/ide/src/hover/tests.rs

+4
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ m!(ab$0c);
303303
---
304304
305305
Outer
306+
306307
---
307308
308309
```rust
@@ -4401,6 +4402,7 @@ fn main() {
44014402
---
44024403
44034404
size = 8, align = 8, niches = 1
4405+
44044406
---
44054407
44064408
```rust
@@ -10094,6 +10096,7 @@ fn bar() {
1009410096
```rust
1009510097
let field: i32
1009610098
```
10099+
1009710100
---
1009810101
1009910102
```rust
@@ -10128,6 +10131,7 @@ fn bar() {
1012810131
---
1012910132
1013010133
size = 4, align = 4
10134+
1013110135
---
1013210136
1013310137
```rust

0 commit comments

Comments
 (0)