fix: Use of lookbehind regex crashes Safari, added lint rule to prevent future accidental regression

This commit is contained in:
Tom Moor
2022-04-08 10:16:55 -07:00
parent 58a059ae33
commit 5fb5e69181
4 changed files with 13 additions and 2 deletions

View File

@@ -46,8 +46,8 @@ export default class Italic extends Mark {
* 1_123_
*/
return [
markInputRule(/(?<=[^_\na-zA-Z0-9]|^)_([^_\n]+)_$/, type),
markInputRule(/(?<=[^*\na-zA-Z0-9]|^)\*([^*\n]+)\*$/, type),
markInputRule(/(?:^|[^_a-zA-Z0-9])(_([^_]+)_)$/, type),
markInputRule(/(?:^|[^*a-zA-Z0-9])(\*([^*]+)\*)$/, type),
];
}