Issue Description
The tokenize_inline function in src/tokenize.rs does not properly handle adjacent links without spaces between them. The current while loop condition on line 105-107 only checks for whitespace and backticks, but should also check for bracket characters to prevent merging adjacent markdown links.
Current Behaviour
Adjacent links like [link1](url1)[link2](url2) may be incorrectly tokenised as a single text token instead of being recognised as separate link tokens.
Proposed Solution
Modify the while loop condition to include bracket detection:
while i < chars.len()
&& !chars[i].is_whitespace()
&& chars[i] != '`'
&& chars[i] != '['
&& !(chars[i] == '!' && i + 1 < chars.len() && chars[i + 1] == '[')
{
i += 1;
}
Context
- File:
src/tokenize.rs
- Lines: 105-107
- Function:
tokenize_inline
References
Issue Description
The
tokenize_inlinefunction insrc/tokenize.rsdoes not properly handle adjacent links without spaces between them. The current while loop condition on line 105-107 only checks for whitespace and backticks, but should also check for bracket characters to prevent merging adjacent markdown links.Current Behaviour
Adjacent links like
[link1](url1)[link2](url2)may be incorrectly tokenised as a single text token instead of being recognised as separate link tokens.Proposed Solution
Modify the while loop condition to include bracket detection:
Context
src/tokenize.rstokenize_inlineReferences