@bendyline/squisq-editor-react 2.11.16 → 2.11.17

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.
@@ -588,7 +588,7 @@ function tiptapToMarkdown(html) {
588
588
  const imgMatch = remaining.match(/^<img\b([^>]*)>/);
589
589
  if (imgMatch) {
590
590
  const attrs = imgMatch[1] ?? "";
591
- const src = /\bsrc="([^"]*)"/i.exec(attrs)?.[1];
591
+ const src = /(?:^|\s)(?:data-squisq-image-)?src="([^"]*)"/i.exec(attrs)?.[1];
592
592
  if (src) {
593
593
  const alt = /\balt="([^"]*)"/i.exec(attrs)?.[1] ?? "";
594
594
  const serialized = serializeImage(src, alt, attrs);
@@ -903,6 +903,7 @@ function serializeImage(src, alt, attrs) {
903
903
  const width = /\bwidth="([^"]*)"/i.exec(attrs)?.[1];
904
904
  const height = /\bheight="([^"]*)"/i.exec(attrs)?.[1];
905
905
  const title = /\btitle="([^"]*)"/i.exec(attrs)?.[1];
906
+ if (title?.startsWith("squisq-upload:")) return "";
906
907
  if (!width && !height) {
907
908
  return `![${alt}](${escapedDestination(src)})`;
908
909
  }
@@ -1188,7 +1189,7 @@ function htmlToInline(html) {
1188
1189
  return `[${text}](${escapedDestination(href)}${titlePart})`;
1189
1190
  });
1190
1191
  result = result.replace(RE_IMG_TAG, (match, attrs) => {
1191
- const src = /\bsrc="([^"]*)"/i.exec(attrs)?.[1];
1192
+ const src = /(?:^|\s)(?:data-squisq-image-)?src="([^"]*)"/i.exec(attrs)?.[1];
1192
1193
  if (!src) return match;
1193
1194
  const alt = /\balt="([^"]*)"/i.exec(attrs)?.[1] ?? "";
1194
1195
  const serialized = serializeImage(src, alt, attrs);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RecorderModal
3
- } from "./chunk-4D7QMRTZ.js";
3
+ } from "./chunk-C6QVA6TO.js";
4
4
 
5
5
  // src/recorder/RecorderButton.tsx
6
6
  import { useCallback, useState } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  markdownToTiptap
3
- } from "./chunk-EN5BYZOE.js";
3
+ } from "./chunk-DPAMJV6A.js";
4
4
 
5
5
  // src/blockRange.ts
6
6
  import { parseMarkdown } from "@bendyline/squisq/markdown";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  NarrationStage,
3
3
  useNarrationStage
4
- } from "./chunk-34FRFDQ6.js";
4
+ } from "./chunk-XZVMKR5Q.js";
5
5
 
6
6
  // src/teleprompter/TeleprompterView.tsx
7
7
  import { jsx } from "react/jsx-runtime";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  MarkdownEscape
3
- } from "./chunk-ZDWZRVAY.js";
3
+ } from "./chunk-2XXBDECJ.js";
4
4
  import {
5
5
  markdownToTiptap,
6
6
  tiptapToMarkdown
7
- } from "./chunk-EN5BYZOE.js";
7
+ } from "./chunk-DPAMJV6A.js";
8
8
 
9
9
  // src/jsonEditor/JsonEditorContext.tsx
10
10
  import { createContext, useContext, useEffect, useMemo } from "react";