FIX: lookbehind assertions aren't available in < iOS 16.4 (#26139)

This would generate an error and prevent the page from loading on "older" iOSes
This commit is contained in:
Régis Hanol 2024-03-12 15:23:14 +01:00 committed by GitHub
parent c78019032d
commit ee3ccc5b67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -443,7 +443,7 @@ function findToken(tokens, marker, level = 0) {
return token?.children ? findToken(token.children, marker, level + 1) : token;
}
const CODE_MARKERS_REGEX = / |```|~~~|(?<!`)`(?!`)|\[code\]/;
const CODE_MARKERS_REGEX = / |```|~~~|[^`]`[^`]|\[code\]/;
const CODE_TOKEN_TYPES = ["code_inline", "code_block", "fence"];
export async function inCodeBlock(text, pos) {