diff options
Diffstat (limited to '')
-rw-r--r-- | src/construct/gfm_autolink_literal.rs | 5 | ||||
-rw-r--r-- | tests/fuzz.rs | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/construct/gfm_autolink_literal.rs b/src/construct/gfm_autolink_literal.rs index 0704da7..5438e36 100644 --- a/src/construct/gfm_autolink_literal.rs +++ b/src/construct/gfm_autolink_literal.rs @@ -470,8 +470,9 @@ pub fn path_inside(tokenizer: &mut Tokenizer) -> State { } _ => { // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>. - if kind_after_index(tokenizer.parse_state.bytes, tokenizer.point.index) - == CharacterKind::Whitespace + if tokenizer.current.is_none() + || kind_after_index(tokenizer.parse_state.bytes, tokenizer.point.index) + == CharacterKind::Whitespace { State::Retry(StateName::GfmAutolinkLiteralPathAfter) } else { diff --git a/tests/fuzz.rs b/tests/fuzz.rs index 54b4f40..522e32f 100644 --- a/tests/fuzz.rs +++ b/tests/fuzz.rs @@ -98,5 +98,11 @@ fn fuzz() -> Result<(), String> { "8-d: autolink literals after tabs (GH-18)" ); + assert_eq!( + to_html_with_options("| a |\n| - |\n| www.a|", &Options::gfm()), + Ok("<table>\n<thead>\n<tr>\n<th>a</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"http://www.a\">www.a</a></td>\n</tr>\n</tbody>\n</table>".into()), + "9: autolink literals that end in table cell delimiter (GH-20)" + ); + Ok(()) } |