fix crash on index error due to hyperlink at the end of the file
This commit is contained in:
parent
4535ccdce7
commit
ba9f47bb57
1 changed files with 1 additions and 1 deletions
|
@ -215,7 +215,7 @@ fn preprocess(string: String) -> String {
|
||||||
let start_delims = vec![b'(', b'<'];
|
let start_delims = vec![b'(', b'<'];
|
||||||
let end_delims = vec![b')', b'>'];
|
let end_delims = vec![b')', b'>'];
|
||||||
let links = finder.links(result.as_str()).filter(|link| {
|
let links = finder.links(result.as_str()).filter(|link| {
|
||||||
(link.start() == 0 || link.end() == result.len())
|
(link.start() == 0 || link.end() == result.len() - 1)
|
||||||
|| (!start_delims.contains(&result_vec[link.start() - 1])
|
|| (!start_delims.contains(&result_vec[link.start() - 1])
|
||||||
&& !end_delims.contains(&result_vec[link.end() + 1]))
|
&& !end_delims.contains(&result_vec[link.end() + 1]))
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue