File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ impl MdFormatter {
28
28
29
29
impl super :: Formatter for MdFormatter {
30
30
fn render ( & self , input : & str ) -> Result < String , Error > {
31
- Ok ( input. to_string ( ) )
31
+ Ok ( input. replace ( " \r \n " , " \n " ) )
32
32
}
33
33
34
34
fn render_options_start ( & self ) -> & ' static str {
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ pub fn convert(
54
54
Format :: Text => Box :: new ( format:: text:: TextFormatter :: new ( url) ) ,
55
55
} ;
56
56
let expanded = hbs:: expand ( file, & * formatter) ?;
57
+ // pulldown-cmark can behave a little differently with Windows newlines,
58
+ // just normalize it.
59
+ let expanded = expanded. replace ( "\r \n " , "\n " ) ;
57
60
formatter. render ( & expanded)
58
61
}
59
62
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ fn run(name: &str) {
29
29
std:: fs:: write ( & expected_path, result) . unwrap ( ) ;
30
30
} else {
31
31
let expected = std:: fs:: read_to_string ( & expected_path) . unwrap ( ) ;
32
+ // Fix if Windows checked out with autocrlf.
33
+ let expected = expected. replace ( "\r \n " , "\n " ) ;
32
34
assert_eq ! ( expected, result) ;
33
35
}
34
36
}
You can’t perform that action at this time.
0 commit comments