Skip to content

Commit

Permalink
Only match one newline when removing links, not two
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Jun 16, 2019
1 parent b56bc84 commit 2892ef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/src/bin/remove_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main () {
});

// Search for the references we need to delete.
let ref_regex = Regex::new(r"\n\[([^\]]+)\]:\s.*\n").unwrap();
let ref_regex = Regex::new(r"(?m)^\[([^\]]+)\]:\s.*\n").unwrap();
let out = ref_regex.replace_all(&first_pass, |caps: &Captures<'_>| {
let capture = caps.at(1).unwrap().to_owned();

Expand Down

0 comments on commit 2892ef6

Please sign in to comment.