@thi.ng/hiccup-markdown 3.2.186 → 3.2.187
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/package.json +2 -2
- package/parse.js +4 -4
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.187",
|
|
4
4
|
"description": "Markdown parser & serializer from/to Hiccup format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
],
|
|
103
103
|
"year": 2018
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "d52222458fba56bf59796f5885a68ca04570b240\n"
|
|
106
106
|
}
|
package/parse.js
CHANGED
|
@@ -74,12 +74,12 @@ olitem: <LSTART> <lilevel> <olid> ". "! <todo>?
|
|
|
74
74
|
list: (<ulitem> | <olitem>)+ <DNL1> ;
|
|
75
75
|
|
|
76
76
|
cbdelim: <LSTART> "\`\`\`"! ;
|
|
77
|
-
codeblock: <cbdelim>! <codemeta> <codebody> <DNL1> ;
|
|
77
|
+
codeblock: <cbdelim>! <codemeta> (<cbdelim>! | <codebody>) <DNL1> ;
|
|
78
78
|
codemeta: .(?+<NL>!) => join ;
|
|
79
79
|
codebody: <cbbody>(?+<cbdelim>) => join ;
|
|
80
80
|
|
|
81
81
|
cudelim: <LSTART> ":::"! ;
|
|
82
|
-
customblock: <cudelim>! <custommeta> <custombody> <DNL1> ;
|
|
82
|
+
customblock: <cudelim>! <custommeta> (<cudelim>! | <custombody>) <DNL1> ;
|
|
83
83
|
custommeta: .(?+<NL>!) => join ;
|
|
84
84
|
custombody: <cubody>(?+<cudelim>) => join ;
|
|
85
85
|
|
|
@@ -310,7 +310,7 @@ const transformScope = defmulti(
|
|
|
310
310
|
code: (scope, ctx, acc) => __collect(acc, ctx.tags.code(ctx, __escape(ctx, scope.result))),
|
|
311
311
|
codeblock: ({ children }, ctx, acc) => {
|
|
312
312
|
const [lang, ...head] = children[0].result.split(" ");
|
|
313
|
-
const body = children[1]
|
|
313
|
+
const body = children[1]?.result.trim() ?? "";
|
|
314
314
|
__collect(
|
|
315
315
|
acc,
|
|
316
316
|
ctx.tags.codeblock(
|
|
@@ -331,7 +331,7 @@ const transformScope = defmulti(
|
|
|
331
331
|
ctx,
|
|
332
332
|
type,
|
|
333
333
|
head,
|
|
334
|
-
children[1]
|
|
334
|
+
children[1]?.result.trim() ?? "",
|
|
335
335
|
ctx.meta
|
|
336
336
|
)
|
|
337
337
|
);
|