@tinacms/mdx 0.0.0-20220803192518 → 0.61.0
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.js +8 -4
- package/dist/parse/index.d.ts +2 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -244674,8 +244674,8 @@ var markdownToAst = (value, field) => {
|
|
|
244674
244674
|
throw new Error("Global templates are not supported");
|
|
244675
244675
|
}
|
|
244676
244676
|
if (template.match) {
|
|
244677
|
-
preprocessedString =
|
|
244678
|
-
preprocessedString =
|
|
244677
|
+
preprocessedString = replaceAll(preprocessedString, template.match.start, `<${template.name}>\``);
|
|
244678
|
+
preprocessedString = replaceAll(preprocessedString, template.match.end, `\`</${template.name}>`);
|
|
244679
244679
|
}
|
|
244680
244680
|
});
|
|
244681
244681
|
try {
|
|
@@ -244722,6 +244722,10 @@ var invalidMarkdown = (e, value) => {
|
|
|
244722
244722
|
]
|
|
244723
244723
|
};
|
|
244724
244724
|
};
|
|
244725
|
+
var replaceAll = (string3, target, value) => {
|
|
244726
|
+
const regex = new RegExp(target, "g");
|
|
244727
|
+
return string3.valueOf().replace(regex, value);
|
|
244728
|
+
};
|
|
244725
244729
|
|
|
244726
244730
|
// src/stringify/acorn.ts
|
|
244727
244731
|
var import_prettier = __toModule(require_prettier());
|
|
@@ -245132,8 +245136,8 @@ var stringifyMDX = (value, field, imageCallback) => {
|
|
|
245132
245136
|
throw new Error("Global templates are not supported");
|
|
245133
245137
|
}
|
|
245134
245138
|
if (template.match) {
|
|
245135
|
-
preprocessedString =
|
|
245136
|
-
preprocessedString =
|
|
245139
|
+
preprocessedString = replaceAll(preprocessedString, `<${template.name}>\``, `${template.match.start} `);
|
|
245140
|
+
preprocessedString = replaceAll(preprocessedString, `\`</${template.name}>`, ` ${template.match.end}`);
|
|
245137
245141
|
}
|
|
245138
245142
|
});
|
|
245139
245143
|
return preprocessedString;
|
package/dist/parse/index.d.ts
CHANGED
|
@@ -66,10 +66,11 @@ import type * as Plate from './plate';
|
|
|
66
66
|
* doesn't change
|
|
67
67
|
*
|
|
68
68
|
* 2. We don't need to do any client-side parsing. Since TinaMarkdown and the slate editor work with the same
|
|
69
|
-
* format we can just allow Tina to do it's thing and update the form
|
|
69
|
+
* format we can just allow Tina to do it's thing and update the form value with no additional work.
|
|
70
70
|
*/
|
|
71
71
|
export declare const markdownToAst: (value: string, field: RichTypeInner) => Md.Root;
|
|
72
72
|
export declare const MDX_PARSE_ERROR_MSG = "TinaCMS supports a stricter version of markdown and a subset of MDX. https://tina.io/docs/editing/mdx/#differences-from-other-mdx-implementations";
|
|
73
73
|
export declare const MDX_PARSE_ERROR_MSG_HTML = "TinaCMS supports a stricter version of markdown and a subset of MDX. <a href=\"https://tina.io/docs/editing/mdx/#differences-from-other-mdx-implementations\" target=\"_blank\" rel=\"noopener noreferrer\">Learn More</a>";
|
|
74
74
|
export declare const parseMDX: (value: string, field: RichTypeInner, imageCallback: (s: string) => string) => Plate.RootElement;
|
|
75
75
|
export declare const invalidMarkdown: (e: RichTextParseError, value: string) => Plate.RootElement;
|
|
76
|
+
export declare const replaceAll: (string: string, target: string, value: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/mdx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"typings": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tinacms/schema-tools": "0.
|
|
21
|
+
"@tinacms/schema-tools": "0.1.0",
|
|
22
22
|
"acorn": "^8.7.1",
|
|
23
23
|
"lodash-es": "^4.17.21",
|
|
24
24
|
"mdast-util-mdx-jsx": "^2.0.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@swc/core": "^1.2.210",
|
|
41
41
|
"@swc/jest": "^0.2.21",
|
|
42
|
-
"@tinacms/scripts": "0.
|
|
42
|
+
"@tinacms/scripts": "0.51.0",
|
|
43
43
|
"@types/cors": "^2.8.7",
|
|
44
44
|
"@types/estree": "^0.0.50",
|
|
45
45
|
"@types/estree-jsx": "^1.0.0",
|