diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-28 18:30:46 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-28 18:30:46 +0200 |
commit | 5d5e94567e7a87a3cefdda410e3bd9e36e26eca5 (patch) | |
tree | d68dbac9cd49c10f8460f46f8c9ab9b25019973c /src/construct | |
parent | e485745c6924e41f2896f579b5454cfb800e13f6 (diff) | |
download | markdown-rs-5d5e94567e7a87a3cefdda410e3bd9e36e26eca5.tar.gz markdown-rs-5d5e94567e7a87a3cefdda410e3bd9e36e26eca5.tar.bz2 markdown-rs-5d5e94567e7a87a3cefdda410e3bd9e36e26eca5.zip |
Fix GFM autolink literals that end in in GFM table pipes
Closes GH-20.
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Diffstat (limited to 'src/construct')
-rw-r--r-- | src/construct/gfm_autolink_literal.rs | 5 |
1 files changed, 3 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 { |