@thi.ng/hiccup-markdown 3.2.172 → 3.2.174
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/README.md +1 -1
- package/package.json +13 -13
- package/parse.js +4 -4
- package/serialize.js +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 211 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hiccup-markdown",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.174",
|
|
4
4
|
"description": "Markdown parser & serializer from/to Hiccup format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/arrays": "^2.14.
|
|
44
|
-
"@thi.ng/checks": "^3.
|
|
45
|
-
"@thi.ng/defmulti": "^3.0.
|
|
46
|
-
"@thi.ng/emoji": "^1.0.
|
|
47
|
-
"@thi.ng/errors": "^2.5.
|
|
48
|
-
"@thi.ng/hiccup": "^5.3.
|
|
49
|
-
"@thi.ng/logger": "^3.2.
|
|
50
|
-
"@thi.ng/parse": "^2.6.
|
|
51
|
-
"@thi.ng/strings": "^3.9.
|
|
52
|
-
"@thi.ng/text-canvas": "^3.0.
|
|
42
|
+
"@thi.ng/api": "^8.12.10",
|
|
43
|
+
"@thi.ng/arrays": "^2.14.3",
|
|
44
|
+
"@thi.ng/checks": "^3.8.0",
|
|
45
|
+
"@thi.ng/defmulti": "^3.0.86",
|
|
46
|
+
"@thi.ng/emoji": "^1.0.29",
|
|
47
|
+
"@thi.ng/errors": "^2.5.50",
|
|
48
|
+
"@thi.ng/hiccup": "^5.3.33",
|
|
49
|
+
"@thi.ng/logger": "^3.2.9",
|
|
50
|
+
"@thi.ng/parse": "^2.6.39",
|
|
51
|
+
"@thi.ng/strings": "^3.9.31",
|
|
52
|
+
"@thi.ng/text-canvas": "^3.0.102"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"esbuild": "^0.27.0",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
],
|
|
102
102
|
"year": 2018
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "8625a1c6383737a8fdbe7a3f96ea3cbabc957fa6\n"
|
|
105
105
|
}
|
package/parse.js
CHANGED
|
@@ -414,7 +414,7 @@ const transformScope = defmulti(
|
|
|
414
414
|
[children[0].id === "ulitem" ? "ul" : "ol"]
|
|
415
415
|
];
|
|
416
416
|
const levels = [0];
|
|
417
|
-
for (
|
|
417
|
+
for (const item of children) {
|
|
418
418
|
const currLevel = item.children[0].result;
|
|
419
419
|
if (currLevel > peek(levels)) {
|
|
420
420
|
const sublist = [item.id === "ulitem" ? "ul" : "ol"];
|
|
@@ -536,7 +536,7 @@ const withMeta = (target, meta) => {
|
|
|
536
536
|
return target;
|
|
537
537
|
};
|
|
538
538
|
const extractBody = (body, acc = []) => {
|
|
539
|
-
for (
|
|
539
|
+
for (const x of isPlainObject(body[1]) ? body.slice(2) : body) {
|
|
540
540
|
if (isPrimitive(x)) acc.push(x);
|
|
541
541
|
else if (isArray(x)) extractBody(x, acc);
|
|
542
542
|
}
|
|
@@ -545,7 +545,7 @@ const extractBody = (body, acc = []) => {
|
|
|
545
545
|
const __collect = (acc, x) => x != null && acc.push(x);
|
|
546
546
|
const __collectPrim = (scope, ctx, acc, tag) => __collect(acc, ctx.tags[tag](ctx, scope.result));
|
|
547
547
|
const __children = (ctx, children, acc = []) => {
|
|
548
|
-
for (
|
|
548
|
+
for (const c of children) transformScope(c, ctx, acc);
|
|
549
549
|
return acc;
|
|
550
550
|
};
|
|
551
551
|
const __escape = (ctx, x) => ctx.opts.escape ? escapeEntities(x) : x;
|
|
@@ -563,7 +563,7 @@ const __trimBody = (body) => {
|
|
|
563
563
|
};
|
|
564
564
|
const __columnAlignments = (children) => {
|
|
565
565
|
const align = [];
|
|
566
|
-
for (
|
|
566
|
+
for (const c of children) {
|
|
567
567
|
const raw = c.children[0].children[0].result.trim();
|
|
568
568
|
const isLeft = raw.startsWith(":-") ? 1 : 0;
|
|
569
569
|
const isRight = raw.endsWith("-:") ? 2 : 0;
|
package/serialize.js
CHANGED
|
@@ -29,7 +29,7 @@ const __serializeTreeElement = (tree, ctx, state) => {
|
|
|
29
29
|
const __serializeIter = (iter, ctx, state) => {
|
|
30
30
|
if (!iter) return "";
|
|
31
31
|
const res = [];
|
|
32
|
-
for (
|
|
32
|
+
for (const i of iter) {
|
|
33
33
|
res.push(__serialize(i, ctx, state));
|
|
34
34
|
}
|
|
35
35
|
return res.join(state.sep);
|