Skip to content

Commit 4f2552a

Browse files
committed
Fix a bug breaking [var html ..]
1 parent 2b5b339 commit 4f2552a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

examples/tests/escapes.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[set t\est 1]
33
[set t\]est 2]
44
[set t\ 3]
5+
[set test2 <p>hello</p>]
56

67
test 1: [var raw test]
78
test 2: \[var raw test]
@@ -11,3 +12,4 @@ test 5: \\\[var raw test]
1112
test 6: [var raw t\est]
1213
test 7: [var raw t\]est]
1314
test 8: [var raw t\\]est]
15+
test 9: [var html test2]

src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn process_directive(
104104

105105
Ok("".to_string())
106106
} else if opt_html || opt_raw || var_html || var_raw {
107-
let (_, var) = directive.split_at(if opt_html { 9 } else { 8 });
107+
let (_, var) = directive.split_at(if var_html || opt_html { 9 } else { 8 });
108108

109109
match context.load_var(var) {
110110
Some(value) => {
@@ -484,6 +484,7 @@ test 5: \[var raw test]
484484
test 6: 1
485485
test 7: 2
486486
test 8: 3est]
487+
test 9: &lt;p&gt;hello&lt;/p&gt;
487488
"#
488489
.trim()
489490
);

0 commit comments

Comments
 (0)