Skip to content

SyntaxError: Invalid regular expression: invalid group specifier name in Safari < 16.4 #3944

@christophe-g

Description

@christophe-g

Marked version:
18.0.0
Describe the bug

Very similar to #3816 - still experiencing an invalid group specifier name in Safari 15.

The regex that is produced for blockSkip (I think as I can only test remotely on compiled code) ends up to be:

r = "\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)|(?<!`)()(?<b>`+)[^`]+\\k<b>(?!`)|<(?! )[^<>]*?>"

running the regex in safari 15 new RegExp(r), produces the above error

To Reproduce
as above

Expected behavior
marked works with older version of Safari

Thank you for this lib and the efforts maintaining it !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions