mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
update & configure cmark to render three backticks
This commit is contained in:
parent
c4d4869f23
commit
b34ad4bc8a
5 changed files with 175 additions and 173 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -903,9 +903,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pulldown-cmark-to-cmark"
|
name = "pulldown-cmark-to-cmark"
|
||||||
version = "4.0.2"
|
version = "5.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cffb594e453d29e238ac190362a4a291daec00396717a8d1670863121ac56958"
|
checksum = "32accf4473121d8c0b508ca5673363703762d6cc59cf25af1df48f653346f736"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pulldown-cmark",
|
"pulldown-cmark",
|
||||||
]
|
]
|
||||||
|
|
|
@ -17,8 +17,8 @@ indexmap = "1.3.2"
|
||||||
itertools = "0.9.0"
|
itertools = "0.9.0"
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
url = "*"
|
url = "2.1.1"
|
||||||
pulldown-cmark-to-cmark = "4.0.2"
|
pulldown-cmark-to-cmark = "5.0.0"
|
||||||
pulldown-cmark = {version = "0.7.2", default-features = false}
|
pulldown-cmark = {version = "0.7.2", default-features = false}
|
||||||
oorandom = "11.1.2"
|
oorandom = "11.1.2"
|
||||||
|
|
||||||
|
|
|
@ -425,9 +425,9 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*iter*
|
*iter*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
Iter<Scan<OtherStruct<OtherStruct<i32>>, |&mut u32, &u32, &mut u32| -> Option<u32>, u32>>
|
Iter<Scan<OtherStruct<OtherStruct<i32>>, |&mut u32, &u32, &mut u32| -> Option<u32>, u32>>
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -444,13 +444,13 @@ fn main() { let foo_test = fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub fn foo() -> u32
|
pub fn foo() -> u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -493,13 +493,13 @@ fn main() { let foo_test = fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str
|
pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -515,13 +515,13 @@ fn main() { }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub fn foo(a: u32, b: u32) -> u32
|
pub fn foo(a: u32, b: u32) -> u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -540,13 +540,13 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*field_a*
|
*field_a*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Foo
|
test::Foo
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
field_a: u32
|
field_a: u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -562,13 +562,13 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*field_a*
|
*field_a*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Foo
|
test::Foo
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
field_a: u32
|
field_a: u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -580,13 +580,13 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
const foo: u32
|
const foo: u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
|
@ -594,13 +594,13 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
static foo: u32
|
static foo: u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -617,9 +617,9 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*zz*
|
*zz*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
Test<i32, u8>
|
Test<i32, u8>
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -636,13 +636,13 @@ fn main() { So<|>me(12); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Some*
|
*Some*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Option
|
test::Option
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
Some
|
Some
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -656,9 +656,9 @@ fn main() { let b<|>ar = Some(12); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*bar*
|
*bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
Option<i32>
|
Option<i32>
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -675,13 +675,13 @@ enum Option<T> {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*None*
|
*None*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Option
|
test::Option
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
None
|
None
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -702,13 +702,13 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Some*
|
*Some*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Option
|
test::Option
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
Some
|
Some
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -724,9 +724,9 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
i32
|
i32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -738,9 +738,9 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
i32
|
i32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -752,9 +752,9 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
i32
|
i32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -766,9 +766,9 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
i32
|
i32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -788,9 +788,9 @@ fn main() { let foo_<|>test = Thing::new(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo_test*
|
*foo_test*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
Thing
|
Thing
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -812,13 +812,13 @@ fn main() { let foo_test = wrapper::Thing::new<|>(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*new*
|
*new*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::wrapper::Thing
|
test::wrapper::Thing
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
fn new() -> Thing
|
fn new() -> Thing
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -843,13 +843,13 @@ fn main() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*C*
|
*C*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
const C: u32
|
const C: u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -925,9 +925,9 @@ fn y() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*x*
|
*x*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
i32
|
i32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -943,13 +943,13 @@ fn f() { fo<|>o!(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
macro_rules! foo
|
macro_rules! foo
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -978,13 +978,13 @@ id! {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
fn foo()
|
fn foo()
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -999,9 +999,9 @@ fn foo(bar:u32) { let a = id!(ba<|>r); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*bar*
|
*bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
u32
|
u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1017,9 +1017,9 @@ fn foo(bar:u32) { let a = id!(ba<|>r); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*bar*
|
*bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
u32
|
u32
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1076,13 +1076,13 @@ fn foo() {
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*bar*
|
*bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
fn bar() -> bool
|
fn bar() -> bool
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1113,13 +1113,13 @@ fn bar() { fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
fn foo()
|
fn foo()
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1135,13 +1135,13 @@ fn bar() { fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
async fn foo()
|
async fn foo()
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
|
@ -1149,13 +1149,13 @@ fn bar() { fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub const unsafe fn foo()
|
pub const unsafe fn foo()
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
|
@ -1163,13 +1163,13 @@ fn bar() { fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub(crate) async unsafe extern "C" fn foo()
|
pub(crate) async unsafe extern "C" fn foo()
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1205,13 +1205,13 @@ fn my() {}
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*my*
|
*my*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
mod my
|
mod my
|
||||||
````
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1228,13 +1228,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
struct Bar
|
struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1255,13 +1255,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
struct Bar
|
struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1284,13 +1284,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
struct Bar
|
struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1315,13 +1315,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1342,13 +1342,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1371,13 +1371,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1398,13 +1398,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1425,13 +1425,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1453,13 +1453,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1480,13 +1480,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1507,13 +1507,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1536,13 +1536,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1563,13 +1563,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1591,13 +1591,13 @@ fn foo() { let bar = Ba<|>r; }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*Bar*
|
*Bar*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test
|
test
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
pub struct Bar
|
pub struct Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1629,13 +1629,13 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Bar
|
test::Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
fn foo(&self)
|
fn foo(&self)
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1667,13 +1667,13 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
test::Bar
|
test::Bar
|
||||||
````
|
```
|
||||||
|
|
||||||
````rust
|
```rust
|
||||||
fn foo(&self)
|
fn foo(&self)
|
||||||
````
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::iter::once;
|
||||||
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use pulldown_cmark::{CowStr, Event, Options, Parser, Tag};
|
use pulldown_cmark::{CowStr, Event, Options, Parser, Tag};
|
||||||
use pulldown_cmark_to_cmark::cmark;
|
use pulldown_cmark_to_cmark::{cmark_with_options, Options as CmarkOptions};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use hir::{Adt, AsName, AttrDef, Crate, Hygiene, ItemInNs, ModPath, ModuleDef};
|
use hir::{Adt, AsName, AttrDef, Crate, Hygiene, ItemInNs, ModPath, ModuleDef};
|
||||||
|
@ -42,7 +42,9 @@ pub fn rewrite_links(db: &RootDatabase, markdown: &str, definition: &Definition)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let mut out = String::new();
|
let mut out = String::new();
|
||||||
cmark(doc, &mut out, None).ok();
|
let mut options = CmarkOptions::default();
|
||||||
|
options.code_block_backticks = 3;
|
||||||
|
cmark_with_options(doc, &mut out, None, options).ok();
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -680,5 +680,5 @@ pub fn foo(_input: TokenStream) -> TokenStream {
|
||||||
});
|
});
|
||||||
|
|
||||||
let value = res.get("contents").unwrap().get("value").unwrap().to_string();
|
let value = res.get("contents").unwrap().get("value").unwrap().to_string();
|
||||||
assert_eq!(value, r#""\n````rust\nfoo::Bar\n````\n\n````rust\nfn bar()\n````""#)
|
assert_eq!(value, r#""\n```rust\nfoo::Bar\n```\n\n```rust\nfn bar()\n```""#)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue