@bendyline/squisq-editor-react 2.13.17 → 2.13.18

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.
@@ -3,11 +3,11 @@ import {
3
3
  AlignedTableHeader,
4
4
  MarkdownEscape,
5
5
  PlainTextClipboard
6
- } from "./chunk-4MBH7MMU.js";
6
+ } from "./chunk-F6URHAW6.js";
7
7
  import {
8
8
  markdownToTiptap,
9
9
  tiptapToMarkdown
10
- } from "./chunk-ZLKINE4Y.js";
10
+ } from "./chunk-SSEE55FT.js";
11
11
 
12
12
  // src/jsonEditor/JsonEditorContext.tsx
13
13
  import { createContext, useContext, useEffect, useMemo } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MARKDOWN_ESCAPE_ATTR
3
- } from "./chunk-ZLKINE4Y.js";
3
+ } from "./chunk-SSEE55FT.js";
4
4
 
5
5
  // src/MarkdownEscape.ts
6
6
  import { Mark, mergeAttributes } from "@tiptap/core";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  markdownToTiptap,
7
7
  tiptapToMarkdown
8
- } from "./chunk-ZLKINE4Y.js";
8
+ } from "./chunk-SSEE55FT.js";
9
9
 
10
10
  // src/InsertMenuItems.tsx
11
11
  import { createContext, useContext, useEffect, useMemo, useRef } from "react";
@@ -704,14 +704,12 @@ function tiptapToMarkdown(html) {
704
704
  const cellRegex = /<(th|td)([^>]*)>(.*?)<\/\1>/gs;
705
705
  let cellExec;
706
706
  while ((cellExec = cellRegex.exec(rowHtml)) !== null) {
707
- const tag = cellExec[1];
708
707
  const attrs = cellExec[2];
709
708
  const content = htmlToTableCell(cellExec[3]);
710
709
  const alignExec = attrs.match(/text-align:\s*(left|center|right)/);
711
710
  cells.push({
712
711
  content,
713
- align: alignExec ? alignExec[1] : null,
714
- isHeader: tag === "th"
712
+ align: alignExec ? alignExec[1] : null
715
713
  });
716
714
  }
717
715
  if (cells.length > 0) {
@@ -719,10 +717,7 @@ function tiptapToMarkdown(html) {
719
717
  }
720
718
  }
721
719
  if (rows.length > 0) {
722
- const headerIdx = rows.findIndex((r) => r.some((c) => c.isHeader));
723
- const hIdx = headerIdx >= 0 ? headerIdx : 0;
724
- const headerRow = rows[hIdx];
725
- const dataRows = rows.filter((_, i) => i !== hIdx);
720
+ const [headerRow, ...dataRows] = rows;
726
721
  const aligns = headerRow.map((c) => c.align);
727
722
  lines.push("| " + headerRow.map((c) => c.content || " ").join(" | ") + " |");
728
723
  lines.push(