Commit 7087180
committed
Fix StringIndexOutOfBoundsException on line after tab (#52)
This could occur in the following situation (\t is a tab):
- foo
\tbar
# baz
The tab on the bar line is a partially consumed tab, so columnIsInTab
would be true. On the next line, we wouldn't reset columnIsInTab.
By the time that addLine is called, we would try to get a substring
starting from "after the tab", resulting in the
StringIndexOutOfBoundsException.1 parent b29c0ec commit 7087180
2 files changed
Lines changed: 15 additions & 3 deletions
File tree
- commonmark/src
- main/java/org/commonmark/internal
- test/java/org/commonmark/test
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | | - | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
147 | | - | |
148 | | - | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| 292 | + | |
| 293 | + | |
289 | 294 | | |
290 | 295 | | |
291 | 296 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
0 commit comments