rme 0.2.3-alpha.7 → 0.2.3-alpha.8
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.
- package/dist/index.mjs +33 -33
- package/dist/index.mjs.map +3 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7830,6 +7830,38 @@ var LineBlockquoteExtension = class extends BlockquoteExtension {
|
|
|
7830
7830
|
}
|
|
7831
7831
|
};
|
|
7832
7832
|
|
|
7833
|
+
// src/editor/inline-input-regex/index.ts
|
|
7834
|
+
var getMdImageInputRule = (nodeType) => [
|
|
7835
|
+
{
|
|
7836
|
+
regexp: /!\[([^\]]*)\]\(([^\s"]+(?:\s+[^\s"]+)*)?(?:\s+"(.*?)")?\)/,
|
|
7837
|
+
type: nodeType,
|
|
7838
|
+
getAttributes: (match) => {
|
|
7839
|
+
const [, alt, src, title] = match;
|
|
7840
|
+
return { alt, src, title };
|
|
7841
|
+
}
|
|
7842
|
+
}
|
|
7843
|
+
];
|
|
7844
|
+
var getInlineMathInputRule = (nodeType) => [
|
|
7845
|
+
// Typed inline math trigger: $$ -> insert empty inline math and focus inside
|
|
7846
|
+
{
|
|
7847
|
+
regexp: /\$\$(?!\$)/,
|
|
7848
|
+
type: nodeType,
|
|
7849
|
+
getAttributes: () => ({ tex: "", fromInput: true })
|
|
7850
|
+
},
|
|
7851
|
+
{
|
|
7852
|
+
regexp: /<span[^>]*data-type=["']math-inline["'][^>]*><\/span>/,
|
|
7853
|
+
type: nodeType,
|
|
7854
|
+
getAttributes: () => ({ fromInput: false })
|
|
7855
|
+
},
|
|
7856
|
+
{
|
|
7857
|
+
regexp: /\$([^$\n]+?)\$/,
|
|
7858
|
+
type: nodeType,
|
|
7859
|
+
getAttributes: (match) => {
|
|
7860
|
+
return { tex: match[1] ?? "", fromInput: true };
|
|
7861
|
+
}
|
|
7862
|
+
}
|
|
7863
|
+
];
|
|
7864
|
+
|
|
7833
7865
|
// src/editor/extensions/Clipboard/clipboard-extension.ts
|
|
7834
7866
|
import { extension as extension2, PlainExtension as PlainExtension2 } from "@remirror/core";
|
|
7835
7867
|
import { DOMParser as DOMParser2, Fragment as Fragment2, Slice } from "@remirror/pm/model";
|
|
@@ -7940,7 +7972,7 @@ var ClipboardExtension = class extends PlainExtension2 {
|
|
|
7940
7972
|
async processMarkdownImageSyntax(node, view) {
|
|
7941
7973
|
const { imageCopyHandler } = this.options;
|
|
7942
7974
|
if (!imageCopyHandler) return;
|
|
7943
|
-
const imageRegex =
|
|
7975
|
+
const imageRegex = new RegExp(getMdImageInputRule("md_image")[0]?.regexp, "g");
|
|
7944
7976
|
const processTextNode = async (n2) => {
|
|
7945
7977
|
if (n2.isText && n2.text) {
|
|
7946
7978
|
let match;
|
|
@@ -8353,38 +8385,6 @@ FindExtension = __decorateClass([
|
|
|
8353
8385
|
})
|
|
8354
8386
|
], FindExtension);
|
|
8355
8387
|
|
|
8356
|
-
// src/editor/inline-input-regex/index.ts
|
|
8357
|
-
var getMdImageInputRule = (nodeType) => [
|
|
8358
|
-
{
|
|
8359
|
-
regexp: /!\[([^\]]*)\]\((\S+)?(?:\s+"(.*?)")?\)/,
|
|
8360
|
-
type: nodeType,
|
|
8361
|
-
getAttributes: (match) => {
|
|
8362
|
-
const [, alt, src, title] = match;
|
|
8363
|
-
return { alt, src, title };
|
|
8364
|
-
}
|
|
8365
|
-
}
|
|
8366
|
-
];
|
|
8367
|
-
var getInlineMathInputRule = (nodeType) => [
|
|
8368
|
-
// Typed inline math trigger: $$ -> insert empty inline math and focus inside
|
|
8369
|
-
{
|
|
8370
|
-
regexp: /\$\$(?!\$)/,
|
|
8371
|
-
type: nodeType,
|
|
8372
|
-
getAttributes: () => ({ tex: "", fromInput: true })
|
|
8373
|
-
},
|
|
8374
|
-
{
|
|
8375
|
-
regexp: /<span[^>]*data-type=["']math-inline["'][^>]*><\/span>/,
|
|
8376
|
-
type: nodeType,
|
|
8377
|
-
getAttributes: () => ({ fromInput: false })
|
|
8378
|
-
},
|
|
8379
|
-
{
|
|
8380
|
-
regexp: /\$([^$\n]+?)\$/,
|
|
8381
|
-
type: nodeType,
|
|
8382
|
-
getAttributes: (match) => {
|
|
8383
|
-
return { tex: match[1] ?? "", fromInput: true };
|
|
8384
|
-
}
|
|
8385
|
-
}
|
|
8386
|
-
];
|
|
8387
|
-
|
|
8388
8388
|
// src/editor/extensions/HandleInput/handle-input-extension.ts
|
|
8389
8389
|
import { PlainExtension as PlainExtension4 } from "@remirror/core";
|
|
8390
8390
|
var HandleInputExtension = class extends PlainExtension4 {
|