@thi.ng/hiccup-markdown 3.2.185 → 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.
Files changed (2) hide show
  1. package/package.json +6 -6
  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.185",
3
+ "version": "3.2.187",
4
4
  "description": "Markdown parser & serializer from/to Hiccup format",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -46,11 +46,11 @@
46
46
  "@thi.ng/defmulti": "^3.0.94",
47
47
  "@thi.ng/emoji": "^1.0.35",
48
48
  "@thi.ng/errors": "^2.6.6",
49
- "@thi.ng/hiccup": "^5.4.0",
49
+ "@thi.ng/hiccup": "^5.4.1",
50
50
  "@thi.ng/logger": "^3.3.0",
51
- "@thi.ng/parse": "^2.6.47",
52
- "@thi.ng/strings": "^3.10.1",
53
- "@thi.ng/text-canvas": "^3.0.113"
51
+ "@thi.ng/parse": "^2.6.48",
52
+ "@thi.ng/strings": "^3.11.0",
53
+ "@thi.ng/text-canvas": "^3.0.114"
54
54
  },
55
55
  "devDependencies": {
56
56
  "esbuild": "^0.27.2",
@@ -102,5 +102,5 @@
102
102
  ],
103
103
  "year": 2018
104
104
  },
105
- "gitHead": "1107498d31504dc63d1a457b5def387d7a134f69\n"
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].result.trim();
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].result.trim(),
334
+ children[1]?.result.trim() ?? "",
335
335
  ctx.meta
336
336
  )
337
337
  );