Skip to content

Bug: Invalid group specifier on @lexical/markdown #8012

@marcojacobsNL

Description

@marcojacobsNL

Lexical version:

Steps To Reproduce

  • Use Safari v15, or iOS < 16.4
  • Visit a site that uses Lexical with Markdown, e.g., https://playground.lexical.dev/
  • Observe that the site fails to load due to an exception

SyntaxError: Invalid regular expression: invalid group specifier name

Link to code example:

`(?<![\\\\\`])(\`)((?:\\\\\`|[^\`])+?)(\`)(?!\`)`,

In this file you can see the Regex that have the look behind expression that is causing the issue.

The current behavior

Lexical/the app crashes

The expected behavior

No crashes

Impact of fix

This breaks Lexical on affected browsers. caniuse indicates that Safari <16.4 (March 2023) is affected in particular.

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