@tiptap/extension-table 3.30.0 → 3.30.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,9 +41,13 @@ export function escapeTableCellPipes(line: string): string {
41
41
  while (j + closeLen < line.length && line[j + closeLen] === '`') closeLen += 1
42
42
  if (closeLen === runLen) {
43
43
  const spanContent = line.slice(i + runLen, j)
44
+ // Matches an already-escaped pipe (`\|`, kept as-is) or a bare pipe
45
+ // (escaped). Deliberately avoids a negative lookbehind assertion:
46
+ // WebKit before Safari 16.4 cannot parse lookbehind, and a regex
47
+ // literal fails the whole chunk at parse time, not at call time.
44
48
  result +=
45
49
  line.slice(i, i + runLen) +
46
- spanContent.replace(/(?<!\\)\|/g, '\\|') +
50
+ spanContent.replace(/\\\||\|/g, match => (match === '|' ? '\\|' : match)) +
47
51
  line.slice(j, j + runLen)
48
52
  i = j + runLen
49
53
  found = true