Skip to content

Commit b8de826

Browse files
committed
fixed a bug causing a failed test and a bad test
1 parent ea19bb0 commit b8de826

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/elements/text.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ fn md_parse_escapes_and_delimiters(text_value: &str) -> (Vec<char>, Vec<Delimite
7575

7676
// first pass process \ and find delimiters
7777
for c in text_value.chars() {
78+
println!("{:?} {}",result,escaped);
7879
let mut add = true;
7980
match (c, escaped) {
8081
('\\', false) => {
8182
add = false;
8283
escaped = true;
8384
}
8485
('\\', true) => {
85-
escaped = true;
86+
escaped = false;
8687
}
8788
// the delimiters
8889
('`', false) | ('_', false) | ('*', false) => {

tests/integration_tests/text_attr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,9 @@ fn test_md() {
621621
<rect xy="0" wh="10" md="m*ult*i\nline" text-loc="br" class="d-text-outside"/>
622622
"#;
623623
let expected = r#"
624-
<rect x=\"0\" y=\"0\" width=\"10\" height=\"10\"/>
625-
<text x=\"11\" y=\"11\" class=\"d-text d-text-top d-text-left\">
626-
<tspan x=\"11\" dy=\"0em\">m</tspan><tspan dy=\"0em\" class=\"d-text-italic\">ult</tspan><tspan dy=\"0em\">i</tspan><tspan x=\"11\" dy=\"1.05em\">line</tspan>
624+
<rect x="0" y="0" width="10" height="10"/>
625+
<text x="11" y="11" class="d-text d-text-top d-text-left">
626+
<tspan x="11" dy="0em">m</tspan><tspan dy="0em" class="d-text-italic">ult</tspan><tspan dy="0em">i</tspan><tspan x="11" dy="1.05em">line</tspan>
627627
</text>
628628
"#;
629629
assert_eq!(

0 commit comments

Comments
 (0)