Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisht13 committed Oct 22, 2024
1 parent f5366d3 commit cdf3e55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/command_templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ impl TemplateValue {
///
/// A `Result` containing a vector of `TemplateValue`s or an error.
pub fn extract_template_vals_from_command(
mut input: &mut str,
input: &str,
templates: Vec<String>,
) -> Result<Vec<TemplateValue>, anyhow::Error> {
// Skip to text/html part
let mut input = input;
let re = Regex::new(r"(?s)Content-Type:\s*text/html;").unwrap();
if let Some(matched) = re.find(input) {
let text_html_idx = matched.end();
input = &mut input[text_html_idx..];
input = &input[text_html_idx..];
}

// Convert the template to a regex pattern, escaping necessary characters and replacing placeholders
Expand Down

0 comments on commit cdf3e55

Please sign in to comment.