Skip to content

Commit

Permalink
Merge pull request #112 from good-praxis/main
Browse files Browse the repository at this point in the history
fix: remove colon escape in text property
  • Loading branch information
hoodie authored Sep 8, 2024
2 parents 3e67779 + ccfa75d commit 9a746a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ impl Property {
.replace('\\', r#"\\"#)
.replace(',', r#"\,"#)
.replace(';', r#"\;"#)
.replace(':', r#"\:"#)
.replace('\n', r#"\N"#)
}

Expand Down Expand Up @@ -440,6 +439,14 @@ mod tests {
assert_eq!(expected, fold_line(line));
}

#[test]
fn escape_special_characters_in_text() {
let line = "\n\\;,:";

let expected = r"\N\\\;\,:";
assert_eq!(expected, Property::escape_text(line));
}

#[cfg(feature = "parser")]
#[test]
fn preserve_spaces() {
Expand Down

0 comments on commit 9a746a7

Please sign in to comment.