Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DimiDumo committed Oct 22, 2024
2 parents 957b16f + 659b12c commit 5b49b7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "relayer-utils"
version = "0.3.9"
version = "0.4.1"
authors = ["Sora Suegami", "Aditya Bisht"]
license = "MIT"
edition = "2018"
Expand Down
5 changes: 5 additions & 0 deletions src/command_templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ pub fn extract_template_vals_from_command(
input: &str,
templates: Vec<String>,
) -> Result<Vec<TemplateValue>, anyhow::Error> {
// Skip to text/html part
let re = Regex::new(r"(?s)Content-Type:\s*text/html;.*?\r?\n\r?\n(.*?)(?:--\S+|$)").unwrap();
let caps = re.captures(input).unwrap();
let input = caps.get(1).unwrap().as_str();

// Convert the template to a regex pattern, escaping necessary characters and replacing placeholders
let pattern = templates
.iter()
Expand Down

0 comments on commit 5b49b7c

Please sign in to comment.