Fix line ending stuff

This commit is contained in:
jimmyfraiture
2025-09-22 14:07:56 +01:00
parent d3bbb287ef
commit cad43c500c
@@ -379,6 +379,7 @@ fn sanitize_value(value: &mut Value, replacements: &[(String, &'static str)]) {
current = current.replace(pattern, replacement);
}
}
normalize_line_endings(&mut current);
*s = current;
}
Value::Array(items) => {
@@ -394,3 +395,10 @@ fn sanitize_value(value: &mut Value, replacements: &[(String, &'static str)]) {
_ => {}
}
}
fn normalize_line_endings(text: &mut String) {
if text.contains('\r') {
let normalized = text.replace("\r\n", "\n").replace('\r', "\n");
*text = normalized;
}
}