@mralfarrakhan/svork 0.8.0-alpha → 0.8.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.
- package/dist/index.mjs +4 -2
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -2280,7 +2280,8 @@ const getComponentSurrogate = (source) => {
|
|
|
2280
2280
|
const getPlaceholderReplacement = (token, type, original) => {
|
|
2281
2281
|
if (type !== "Expression" && type !== "ComponentBoundary") return token;
|
|
2282
2282
|
const surrogate = type === "Expression" ? getExpressionSurrogate(original) : getComponentSurrogate(original);
|
|
2283
|
-
|
|
2283
|
+
const tag = type === "ComponentBoundary" ? "div" : "svork-placeholder";
|
|
2284
|
+
return `<${tag} data-svork-id="${escapeHtmlAttribute(token)}">${escapeHtmlText(surrogate)}</${tag}>`;
|
|
2284
2285
|
};
|
|
2285
2286
|
const isSvelteAttribute = (attr) => {
|
|
2286
2287
|
if (!attr || attr.type !== "Attribute") return true;
|
|
@@ -2386,7 +2387,8 @@ const svelteMarkdown = (options) => {
|
|
|
2386
2387
|
hasModuleScript = true;
|
|
2387
2388
|
}
|
|
2388
2389
|
const escPlaceholder = escapeRegExp(placeholder);
|
|
2389
|
-
const
|
|
2390
|
+
const markerTag = info.type === "ComponentBoundary" ? "div" : "svork-placeholder";
|
|
2391
|
+
const markerPattern = `<${markerTag}\\s+data-svork-id=(["'])${escPlaceholder}\\1[^>]*>[\\s\\S]*?<\\/${markerTag}>`;
|
|
2390
2392
|
const markerRegex = new RegExp(markerPattern, "g");
|
|
2391
2393
|
if (info.type === "ComponentBoundary" || info.type === "InstanceScript" || info.type === "ModuleScript" || info.type === "EscapedText") {
|
|
2392
2394
|
const pMarkerRegex = new RegExp(`<p>\\s*${markerPattern}\\s*</p>`, "g");
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mralfarrakhan/svork",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.2",
|
|
5
5
|
"description": "Svelte utilities for writing blog",
|
|
6
6
|
"author": "mralfarrakhan <alfarrakhan@gmail.com",
|
|
7
7
|
"license": "AGPL-3.0-or-later",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/mralfarrakhan/svork.git"
|
|
10
|
+
"url": "git+https://github.com/mralfarrakhan/svork.git"
|
|
11
11
|
},
|
|
12
12
|
"main": "./dist/index.cjs",
|
|
13
13
|
"module": "./dist/index.mjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"prepare": "bunx tsdown --dst"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@myriaddreamin/typst-ts-node-compiler": "^0.
|
|
44
|
+
"@myriaddreamin/typst-ts-node-compiler": "^0.8.0-rc1",
|
|
45
45
|
"@shikijs/rehype": "^4.1.0",
|
|
46
46
|
"@types/js-yaml": "^4.0.9",
|
|
47
47
|
"@types/node": "^25.9.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"svelte": ">=5.0.0",
|
|
62
|
-
"@myriaddreamin/typst-ts-node-compiler": ">=0.
|
|
62
|
+
"@myriaddreamin/typst-ts-node-compiler": ">=0.8.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"@myriaddreamin/typst-ts-node-compiler": {
|