aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-26 13:14:15 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-26 13:14:15 +0200
commite139a804a109f1e785238f15d361ada980cca778 (patch)
tree49664656ee3e671362b4a26261d4bacf7990ce5f /src
parentdb3c46a613a2b1c1671a38f87fdd268a12539c3f (diff)
downloadmarkdown-rs-e139a804a109f1e785238f15d361ada980cca778.tar.gz
markdown-rs-e139a804a109f1e785238f15d361ada980cca778.tar.bz2
markdown-rs-e139a804a109f1e785238f15d361ada980cca778.zip
Fix GFM autolink literals after tabs
Closes GH-18. Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/event.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/event.rs b/src/event.rs
index a63a475..35eaa74 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -3512,8 +3512,11 @@ impl Point {
b'\n' | b'\r' => unreachable!("cannot move past line endings"),
b'\t' => {
let remainder = next.column % TAB_SIZE;
- debug_assert_ne!(remainder, 0, "expected remainder larger than `0`");
- let vs = TAB_SIZE - remainder;
+ let vs = if remainder == 0 {
+ 0
+ } else {
+ TAB_SIZE - remainder
+ };
next.index += 1;
next.column += 1 + vs;
}