block: limit ordered list number width
use 64-bit to not let limit be too low, 32-bit allows for only 6 alpha digits, "zzzzzz".
This commit is contained in:
parent
4b52fb0832
commit
dc38076f50
2 changed files with 11 additions and 5 deletions
|
@ -734,9 +734,15 @@ impl IdentifiedBlock {
|
|||
return None;
|
||||
};
|
||||
|
||||
let max_len = match numbering {
|
||||
Decimal => 19,
|
||||
AlphaLower | AlphaUpper | RomanLower | RomanUpper => 13,
|
||||
};
|
||||
|
||||
let chars_num = chars.clone();
|
||||
let len_num = 1 + chars_num
|
||||
.clone()
|
||||
.take(max_len - 1)
|
||||
.take_while(|c| match numbering {
|
||||
Decimal => c.is_ascii_digit(),
|
||||
AlphaLower => c.is_ascii_lowercase(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue