Fix number of skips on parsing code block
This commit is contained in:
parent
80b64fe883
commit
1141580878
|
@ -289,7 +289,7 @@ fn find_block_end(haystack: &str, delimiter: &str) -> Option<usize> {
|
||||||
b'/' => match remain.as_bytes().get(pos + 1).copied() {
|
b'/' => match remain.as_bytes().get(pos + 1).copied() {
|
||||||
Some(b'/') => unwrap_or_break!(find_comment_end(&remain[pos..])),
|
Some(b'/') => unwrap_or_break!(find_comment_end(&remain[pos..])),
|
||||||
Some(b'*') => unwrap_or_break!(find_block_comment_end(&remain[pos..])),
|
Some(b'*') => unwrap_or_break!(find_block_comment_end(&remain[pos..])),
|
||||||
_ => pos + 1,
|
_ => 1,
|
||||||
},
|
},
|
||||||
b'\"' => {
|
b'\"' => {
|
||||||
// check if the literal is a raw string
|
// check if the literal is a raw string
|
||||||
|
@ -311,7 +311,7 @@ fn find_block_end(haystack: &str, delimiter: &str) -> Option<usize> {
|
||||||
if remain[pos..].starts_with(delimiter) {
|
if remain[pos..].starts_with(delimiter) {
|
||||||
return Some(haystack.len() - remain.len() + pos + delimiter.len());
|
return Some(haystack.len() - remain.len() + pos + delimiter.len());
|
||||||
} else {
|
} else {
|
||||||
pos + 1
|
1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue