File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -535,6 +535,12 @@ impl<'a> State<'a> {
535
535
} ;
536
536
}
537
537
538
+ // Some of the operations above seem to end up right in a utf8 boundary
539
+ // (see GH-170 for more info).
540
+ // Move back.
541
+ while !value. is_char_boundary ( start) {
542
+ start -= 1 ;
543
+ }
538
544
result. push_str ( & escape_backslashes ( & value[ start..end] , config. after ) ) ;
539
545
540
546
result
Original file line number Diff line number Diff line change @@ -104,4 +104,17 @@ fn paragraph() {
104
104
"a\t 	\n 	\t b\n " ,
105
105
"should encode spaces around line endings in paragraphs"
106
106
) ;
107
+
108
+ assert_eq ! (
109
+ to( & Node :: Paragraph ( Paragraph {
110
+ children: vec![ Node :: Text ( Text {
111
+ value: String :: from( "я_я" ) ,
112
+ position: None
113
+ } ) ] ,
114
+ position: None
115
+ } ) )
116
+ . unwrap( ) ,
117
+ "яяя\n " ,
118
+ "should support escaping around non-ascii"
119
+ ) ;
107
120
}
You can’t perform that action at this time.
0 commit comments