Skip to content

Commit 55d79e1

Browse files
author
Niko Matsakis
committed
fix regex to be more narrowly scoped
1 parent a570298 commit 55d79e1

File tree

1 file changed

+2
-2
lines changed
  • crates/rust-project-goals-cli/src

1 file changed

+2
-2
lines changed

crates/rust-project-goals-cli/src/rfc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ pub fn generate_rfc(path: &Path) -> anyhow::Result<()> {
9292
)
9393
})?;
9494

95-
let regex = Regex::new(r"\((.*).md(#[^)]*)?\)").unwrap();
95+
let regex = Regex::new(r"\]\(([^(]*)\.md(#[^)]*)?\)").unwrap();
9696

9797
let result = regex.replace_all(
9898
&generated_text,
99-
format!("(https://rust-lang.github.io/rust-project-goals/{timeframe}/$1.html$2)"),
99+
format!("](https://rust-lang.github.io/rust-project-goals/{timeframe}/$1.html$2)"),
100100
);
101101

102102
println!("{result}");

0 commit comments

Comments
 (0)