Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(extension-code): support safari versions 16.4 and older #5916

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/itchy-carrots-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/extension-code": patch
---

Implement `inputRegex` and `pasteRegex` while avoiding lookbehind for compatibility with safari versions older than 16.4
4 changes: 2 additions & 2 deletions packages/extension-code/src/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ declare module '@tiptap/core' {
* This ensures that any text between backticks is formatted as code,
* regardless of the surrounding characters (exception being another backtick).
*/
export const inputRegex = /(?<!`)`([^`]+)`(?!`)/
export const inputRegex = /(^|[^`])`([^`]+)`(?!`)/

/**
* Matches inline code while pasting.
*/
export const pasteRegex = /(?<!`)`([^`]+)`(?!`)/g
export const pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g

/**
* This extension allows you to mark text as inline code.
Expand Down
Loading