Skip to content

Commit

Permalink
fix: text/html cutoff
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisht13 committed Oct 22, 2024
1 parent 659b12c commit e63ba84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/command_templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ pub fn extract_template_vals_from_command(
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();
let re = Regex::new(r"(?s)Content-Type:\s*text/html;").unwrap();
let text_html_idx = re.find(input).unwrap().end();
let input = &input[text_html_idx..];

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

0 comments on commit e63ba84

Please sign in to comment.