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> {
535535 } ;
536536 }
537537
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+ }
538544 result. push_str ( & escape_backslashes ( & value[ start..end] , config. after ) ) ;
539545
540546 result
Original file line number Diff line number Diff line change @@ -104,4 +104,17 @@ fn paragraph() {
104104 "a\t 	\n 	\t b\n " ,
105105 "should encode spaces around line endings in paragraphs"
106106 ) ;
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+ ) ;
107120}
You can’t perform that action at this time.
0 commit comments