Skip to content

Commit e53d348

Browse files
committed
fix: use cmark_with_options to write shortcuts links to the output
1 parent 9063268 commit e53d348

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/ide/src/doc_links.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod intra_doc_links;
88
use std::ops::Range;
99

1010
use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag};
11-
use pulldown_cmark_to_cmark::{Options as CMarkOptions, cmark_resume_with_options};
11+
use pulldown_cmark_to_cmark::{Options as CMarkOptions, cmark_with_options};
1212
use stdx::format_to;
1313
use url::Url;
1414

@@ -89,10 +89,9 @@ pub(crate) fn rewrite_links(
8989
}
9090
});
9191
let mut out = String::new();
92-
cmark_resume_with_options(
92+
cmark_with_options(
9393
doc,
9494
&mut out,
95-
None,
9695
CMarkOptions { code_block_token_count: 3, ..Default::default() },
9796
)
9897
.ok();
@@ -125,10 +124,9 @@ pub(crate) fn remove_links(markdown: &str) -> String {
125124
});
126125

127126
let mut out = String::new();
128-
cmark_resume_with_options(
127+
cmark_with_options(
129128
doc,
130129
&mut out,
131-
None,
132130
CMarkOptions { code_block_token_count: 3, ..Default::default() },
133131
)
134132
.ok();

crates/ide/src/doc_links/tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,10 @@ pub struct $0Foo;
724724
/// [`foo`]: Foo
725725
pub struct $0Foo;
726726
"#,
727-
expect![["[`foo`]"]],
727+
expect![[r#"
728+
[`foo`]
729+
730+
[`foo`]: https://docs.rs/foo/*/foo/struct.Foo.html"#]],
728731
);
729732
}
730733

0 commit comments

Comments
 (0)