File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -3512,8 +3512,11 @@ impl Point {
35123512 b'\n' | b'\r' => unreachable ! ( "cannot move past line endings" ) ,
35133513 b'\t' => {
35143514 let remainder = next. column % TAB_SIZE ;
3515- debug_assert_ne ! ( remainder, 0 , "expected remainder larger than `0`" ) ;
3516- let vs = TAB_SIZE - remainder;
3515+ let vs = if remainder == 0 {
3516+ 0
3517+ } else {
3518+ TAB_SIZE - remainder
3519+ } ;
35173520 next. index += 1 ;
35183521 next. column += 1 + vs;
35193522 }
Original file line number Diff line number Diff line change @@ -74,5 +74,29 @@ fn fuzz() -> Result<(), String> {
7474 "7: lazy container lines almost starting fenced code (GH-19)"
7575 ) ;
7676
77+ assert_eq ! (
78+ to_html_with_options( "a\t b@c.d" , & Options :: gfm( ) ) ,
79+ Ok ( "<p>a\t <a href=\" mailto:b@c.d\" >b@c.d</a></p>" . into( ) ) ,
80+ "8-a: autolink literals after tabs (GH-18)"
81+ ) ;
82+
83+ assert_eq ! (
84+ to_html_with_options( "aa\t b@c.d" , & Options :: gfm( ) ) ,
85+ Ok ( "<p>aa\t <a href=\" mailto:b@c.d\" >b@c.d</a></p>" . into( ) ) ,
86+ "8-b: autolink literals after tabs (GH-18)"
87+ ) ;
88+
89+ assert_eq ! (
90+ to_html_with_options( "aaa\t b@c.d" , & Options :: gfm( ) ) ,
91+ Ok ( "<p>aaa\t <a href=\" mailto:b@c.d\" >b@c.d</a></p>" . into( ) ) ,
92+ "8-c: autolink literals after tabs (GH-18)"
93+ ) ;
94+
95+ assert_eq ! (
96+ to_html_with_options( "aaaa\t b@c.d" , & Options :: gfm( ) ) ,
97+ Ok ( "<p>aaaa\t <a href=\" mailto:b@c.d\" >b@c.d</a></p>" . into( ) ) ,
98+ "8-d: autolink literals after tabs (GH-18)"
99+ ) ;
100+
77101 Ok ( ( ) )
78102}
You can’t perform that action at this time.
0 commit comments