We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ee436f commit c7dfdf8Copy full SHA for c7dfdf8
crates/engarde/src/raw.rs
@@ -44,7 +44,7 @@ fn html_escape(input: &str) -> String {
44
let mut result = String::new();
45
let mut last = 0;
46
let mut skip = 0;
47
- for (i, c) in input.chars().enumerate() {
+ for (i, c) in input.char_indices() {
48
if skip > 0 {
49
skip -= 1;
50
continue;
@@ -99,4 +99,12 @@ mod test {
99
let output = syntax.format(CODEBLOCK, Some("rust"), Some(""));
100
assert_eq!(output, CODEBLOCK_RENDERED.to_string());
101
}
102
+
103
+ const CODEBLOCK2: &str = r#"// comment with utf-8 你好 😎 <hello>"#;
104
105
+ #[test]
106
+ fn codeblock_renders_rust_utf8() {
107
+ let syntax = Raw::new();
108
+ let _output = syntax.format(CODEBLOCK2, Some("rust"), Some(""));
109
+ }
110
0 commit comments