quikdown 1.2.7 → 1.2.9

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 (61) hide show
  1. package/README.md +9 -4
  2. package/dist/quikdown.cjs +496 -243
  3. package/dist/quikdown.dark.css +1 -1
  4. package/dist/quikdown.esm.js +496 -243
  5. package/dist/quikdown.esm.min.js +2 -2
  6. package/dist/quikdown.esm.min.js.gz +0 -0
  7. package/dist/quikdown.esm.min.js.map +1 -1
  8. package/dist/quikdown.light.css +1 -1
  9. package/dist/quikdown.umd.js +496 -243
  10. package/dist/quikdown.umd.min.js +2 -2
  11. package/dist/quikdown.umd.min.js.gz +0 -0
  12. package/dist/quikdown.umd.min.js.map +1 -1
  13. package/dist/quikdown_ast.cjs +2 -2
  14. package/dist/quikdown_ast.esm.js +2 -2
  15. package/dist/quikdown_ast.esm.min.js +2 -2
  16. package/dist/quikdown_ast.esm.min.js.gz +0 -0
  17. package/dist/quikdown_ast.umd.js +2 -2
  18. package/dist/quikdown_ast.umd.min.js +2 -2
  19. package/dist/quikdown_ast.umd.min.js.gz +0 -0
  20. package/dist/quikdown_ast_html.cjs +3 -3
  21. package/dist/quikdown_ast_html.esm.js +3 -3
  22. package/dist/quikdown_ast_html.esm.min.js +2 -2
  23. package/dist/quikdown_ast_html.esm.min.js.gz +0 -0
  24. package/dist/quikdown_ast_html.umd.js +3 -3
  25. package/dist/quikdown_ast_html.umd.min.js +2 -2
  26. package/dist/quikdown_ast_html.umd.min.js.gz +0 -0
  27. package/dist/quikdown_bd.cjs +496 -243
  28. package/dist/quikdown_bd.esm.js +496 -243
  29. package/dist/quikdown_bd.esm.min.js +2 -2
  30. package/dist/quikdown_bd.esm.min.js.gz +0 -0
  31. package/dist/quikdown_bd.esm.min.js.map +1 -1
  32. package/dist/quikdown_bd.umd.js +496 -243
  33. package/dist/quikdown_bd.umd.min.js +2 -2
  34. package/dist/quikdown_bd.umd.min.js.gz +0 -0
  35. package/dist/quikdown_bd.umd.min.js.map +1 -1
  36. package/dist/quikdown_edit.cjs +760 -327
  37. package/dist/quikdown_edit.esm.js +760 -327
  38. package/dist/quikdown_edit.esm.min.js +3 -3
  39. package/dist/quikdown_edit.esm.min.js.gz +0 -0
  40. package/dist/quikdown_edit.esm.min.js.map +1 -1
  41. package/dist/quikdown_edit.umd.js +760 -327
  42. package/dist/quikdown_edit.umd.min.js +3 -3
  43. package/dist/quikdown_edit.umd.min.js.gz +0 -0
  44. package/dist/quikdown_edit.umd.min.js.map +1 -1
  45. package/dist/quikdown_edit_standalone.esm.min.js.gz +0 -0
  46. package/dist/quikdown_edit_standalone.umd.min.js.gz +0 -0
  47. package/dist/quikdown_json.cjs +3 -3
  48. package/dist/quikdown_json.esm.js +3 -3
  49. package/dist/quikdown_json.esm.min.js +2 -2
  50. package/dist/quikdown_json.esm.min.js.gz +0 -0
  51. package/dist/quikdown_json.umd.js +3 -3
  52. package/dist/quikdown_json.umd.min.js +2 -2
  53. package/dist/quikdown_json.umd.min.js.gz +0 -0
  54. package/dist/quikdown_yaml.cjs +3 -3
  55. package/dist/quikdown_yaml.esm.js +3 -3
  56. package/dist/quikdown_yaml.esm.min.js +2 -2
  57. package/dist/quikdown_yaml.esm.min.js.gz +0 -0
  58. package/dist/quikdown_yaml.umd.js +3 -3
  59. package/dist/quikdown_yaml.umd.min.js +2 -2
  60. package/dist/quikdown_yaml.umd.min.js.gz +0 -0
  61. package/package.json +18 -13
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * quikdown_json - JSON Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  // Version will be injected at build time
18
- const quikdownVersion$1 = '1.2.7';
18
+ const quikdownVersion$1 = '1.2.9';
19
19
 
20
20
  // Safety limit to prevent infinite loops in list parsing
21
21
  const MAX_LOOP_ITERATIONS = 1000;
@@ -521,7 +521,7 @@ if (typeof window !== 'undefined') {
521
521
 
522
522
 
523
523
  // Version will be injected at build time
524
- const quikdownVersion = '1.2.7';
524
+ const quikdownVersion = '1.2.9';
525
525
 
526
526
  /**
527
527
  * Convert markdown to JSON
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * quikdown_json - JSON Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  // Version will be injected at build time
16
- const quikdownVersion$1 = '1.2.7';
16
+ const quikdownVersion$1 = '1.2.9';
17
17
 
18
18
  // Safety limit to prevent infinite loops in list parsing
19
19
  const MAX_LOOP_ITERATIONS = 1000;
@@ -519,7 +519,7 @@ if (typeof window !== 'undefined') {
519
519
 
520
520
 
521
521
  // Version will be injected at build time
522
- const quikdownVersion = '1.2.7';
522
+ const quikdownVersion = '1.2.9';
523
523
 
524
524
  /**
525
525
  * Convert markdown to JSON
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * quikdown_json - JSON Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
7
- function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const l=[],r=e.split("\n");let o=0;for(;o<r.length;){const e=r[o];if(""===e.trim()){o++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),i=[];for(o++;o<r.length;){if(r[o].match(/^(```|~~~)\s*$/)){o++;break}i.push(r[o]),o++}l.push({type:"code_block",lang:n||null,content:i.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){l.push({type:"hr"}),o++;continue}const h=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,e,t]=h;l.push({type:"heading",level:e.length,children:c(t)}),o++;continue}if(e.includes("|")){const e=n(r,o);if(e){l.push(e.node),o=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;o<r.length&&r[o].match(/^>\s*/);)e.push(r[o].replace(/^>\s*/,"")),o++;l.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=i(r,o);l.push(e.node),o=e.nextIndex;continue}const u=[];for(;o<r.length;){const e=r[o];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&o+1<r.length&&/^\|?[\s\-:|]+\|?$/.test(r[o+1]))break;u.push(e),o++}u.length>0&&l.push({type:"paragraph",children:c(u.join("\n"))})}return l}function n(e,t,n){if(t+1>=e.length)return null;const i=e[t],l=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(l)||!l.includes("-"))return null;const r=s(i);if(0===r.length)return null;const o=s(l).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),h=r.map(e=>c(e.trim())),u=[];let d=t+2;for(;d<e.length;){const t=e[d];if(!t.includes("|")||""===t.trim())break;const n=s(t);u.push(n.map(e=>c(e.trim()))),d++}return{node:{type:"table",headers:h,rows:u,alignments:o},nextIndex:d}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function i(e,t,n){const s=[];let l=t,r=0;const o=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(o[2]),u=o[1].length;for(;l<e.length&&r<1e3;){r++;const t=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,o,d]=t,p=n.length;if(p<u)break;const f=/^\d+\./.test(o);if(p===u&&f!==h)break;if(p>u){const t=[];let n=0;for(;l<e.length&&n<1e3;){n++;const s=e[l],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<u)break;if(i[1].length===u)break;t.push(s),l++}if(t.length>0&&s.length>0){const e=i(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const a={type:"list_item",checked:null,children:null},m=d.match(/^\[([x ])\]\s*(.*)$/i);m&&!h?(a.checked="x"===m[1].toLowerCase(),a.children=c(m[2])):a.children=c(d),s.push(a),l++}return{node:{type:"list",ordered:h,items:s},nextIndex:l}}function c(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),i=s.slice(0,t),c=s.slice(t+1);if(i.endsWith(" ")||i.endsWith("\\")){const t=i.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...l(t)),n.push({type:"br"}),s=c,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const i=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(i){n.push({type:"link",url:i[2].trim(),children:l(i[1])}),s=s.slice(i[0].length),e=!0;continue}const c=s.match(/^`([^`]+)`/);if(c){n.push({type:"code",value:c[1]}),s=s.slice(c[0].length),e=!0;continue}const r=s.match(/^(\*\*|__)(.+?)\1/);if(r){n.push({type:"strong",children:l(r[2])}),s=s.slice(r[0].length),e=!0;continue}const o=s.match(/^~~(.+?)~~/);if(o){n.push({type:"del",children:l(o[1])}),s=s.slice(o[0].length),e=!0;continue}const h=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(h){n.push({type:"em",children:l(h[2])}),s=s.slice(h[0].length),e=!0;continue}const u=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(u)n.push({type:"link",url:u[1],children:[{type:"text",value:u[1]}]}),s=s.slice(u[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function l(e,t){return c(e.replace(/\n/g," "))}e.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function r(t,n={}){const s=e(t,n),i=void 0!==n.indent?n.indent:2;return JSON.stringify(s,null,i)}r.parse=e,r.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=r),"undefined"!=typeof window&&(window.quikdown_json=r);export{r as default};
7
+ function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const l=[],r=e.split("\n");let o=0;for(;o<r.length;){const e=r[o];if(""===e.trim()){o++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),i=[];for(o++;o<r.length;){if(r[o].match(/^(```|~~~)\s*$/)){o++;break}i.push(r[o]),o++}l.push({type:"code_block",lang:n||null,content:i.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){l.push({type:"hr"}),o++;continue}const h=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,e,t]=h;l.push({type:"heading",level:e.length,children:c(t)}),o++;continue}if(e.includes("|")){const e=n(r,o);if(e){l.push(e.node),o=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;o<r.length&&r[o].match(/^>\s*/);)e.push(r[o].replace(/^>\s*/,"")),o++;l.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=i(r,o);l.push(e.node),o=e.nextIndex;continue}const u=[];for(;o<r.length;){const e=r[o];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&o+1<r.length&&/^\|?[\s\-:|]+\|?$/.test(r[o+1]))break;u.push(e),o++}u.length>0&&l.push({type:"paragraph",children:c(u.join("\n"))})}return l}function n(e,t,n){if(t+1>=e.length)return null;const i=e[t],l=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(l)||!l.includes("-"))return null;const r=s(i);if(0===r.length)return null;const o=s(l).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),h=r.map(e=>c(e.trim())),u=[];let d=t+2;for(;d<e.length;){const t=e[d];if(!t.includes("|")||""===t.trim())break;const n=s(t);u.push(n.map(e=>c(e.trim()))),d++}return{node:{type:"table",headers:h,rows:u,alignments:o},nextIndex:d}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function i(e,t,n){const s=[];let l=t,r=0;const o=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(o[2]),u=o[1].length;for(;l<e.length&&r<1e3;){r++;const t=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,o,d]=t,p=n.length;if(p<u)break;const f=/^\d+\./.test(o);if(p===u&&f!==h)break;if(p>u){const t=[];let n=0;for(;l<e.length&&n<1e3;){n++;const s=e[l],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<u)break;if(i[1].length===u)break;t.push(s),l++}if(t.length>0&&s.length>0){const e=i(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const a={type:"list_item",checked:null,children:null},m=d.match(/^\[([x ])\]\s*(.*)$/i);m&&!h?(a.checked="x"===m[1].toLowerCase(),a.children=c(m[2])):a.children=c(d),s.push(a),l++}return{node:{type:"list",ordered:h,items:s},nextIndex:l}}function c(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),i=s.slice(0,t),c=s.slice(t+1);if(i.endsWith(" ")||i.endsWith("\\")){const t=i.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...l(t)),n.push({type:"br"}),s=c,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const i=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(i){n.push({type:"link",url:i[2].trim(),children:l(i[1])}),s=s.slice(i[0].length),e=!0;continue}const c=s.match(/^`([^`]+)`/);if(c){n.push({type:"code",value:c[1]}),s=s.slice(c[0].length),e=!0;continue}const r=s.match(/^(\*\*|__)(.+?)\1/);if(r){n.push({type:"strong",children:l(r[2])}),s=s.slice(r[0].length),e=!0;continue}const o=s.match(/^~~(.+?)~~/);if(o){n.push({type:"del",children:l(o[1])}),s=s.slice(o[0].length),e=!0;continue}const h=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(h){n.push({type:"em",children:l(h[2])}),s=s.slice(h[0].length),e=!0;continue}const u=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(u)n.push({type:"link",url:u[1],children:[{type:"text",value:u[1]}]}),s=s.slice(u[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function l(e,t){return c(e.replace(/\n/g," "))}e.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function r(t,n={}){const s=e(t,n),i=void 0!==n.indent?n.indent:2;return JSON.stringify(s,null,i)}r.parse=e,r.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=r),"undefined"!=typeof window&&(window.quikdown_json=r);export{r as default};
8
8
  //# sourceMappingURL=quikdown_json.esm.min.js.map
Binary file
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * quikdown_json - JSON Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
@@ -19,7 +19,7 @@
19
19
  */
20
20
 
21
21
  // Version will be injected at build time
22
- const quikdownVersion$1 = '1.2.7';
22
+ const quikdownVersion$1 = '1.2.9';
23
23
 
24
24
  // Safety limit to prevent infinite loops in list parsing
25
25
  const MAX_LOOP_ITERATIONS = 1000;
@@ -525,7 +525,7 @@
525
525
 
526
526
 
527
527
  // Version will be injected at build time
528
- const quikdownVersion = '1.2.7';
528
+ const quikdownVersion = '1.2.9';
529
529
 
530
530
  /**
531
531
  * Convert markdown to JSON
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * quikdown_json - JSON Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).quikdown_json=t()}(this,function(){"use strict";function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const l=[],o=e.split("\n");let r=0;for(;r<o.length;){const e=o[r];if(""===e.trim()){r++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),i=[];for(r++;r<o.length;){if(o[r].match(/^(```|~~~)\s*$/)){r++;break}i.push(o[r]),r++}l.push({type:"code_block",lang:n||null,content:i.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){l.push({type:"hr"}),r++;continue}const h=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,e,t]=h;l.push({type:"heading",level:e.length,children:c(t)}),r++;continue}if(e.includes("|")){const e=n(o,r);if(e){l.push(e.node),r=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;r<o.length&&o[r].match(/^>\s*/);)e.push(o[r].replace(/^>\s*/,"")),r++;l.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=i(o,r);l.push(e.node),r=e.nextIndex;continue}const u=[];for(;r<o.length;){const e=o[r];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&r+1<o.length&&/^\|?[\s\-:|]+\|?$/.test(o[r+1]))break;u.push(e),r++}u.length>0&&l.push({type:"paragraph",children:c(u.join("\n"))})}return l}function n(e,t,n){if(t+1>=e.length)return null;const i=e[t],l=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(l)||!l.includes("-"))return null;const o=s(i);if(0===o.length)return null;const r=s(l).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),h=o.map(e=>c(e.trim())),u=[];let d=t+2;for(;d<e.length;){const t=e[d];if(!t.includes("|")||""===t.trim())break;const n=s(t);u.push(n.map(e=>c(e.trim()))),d++}return{node:{type:"table",headers:h,rows:u,alignments:r},nextIndex:d}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function i(e,t,n){const s=[];let l=t,o=0;const r=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(r[2]),u=r[1].length;for(;l<e.length&&o<1e3;){o++;const t=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,r,d]=t,f=n.length;if(f<u)break;const p=/^\d+\./.test(r);if(f===u&&p!==h)break;if(f>u){const t=[];let n=0;for(;l<e.length&&n<1e3;){n++;const s=e[l],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<u)break;if(i[1].length===u)break;t.push(s),l++}if(t.length>0&&s.length>0){const e=i(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const a={type:"list_item",checked:null,children:null},m=d.match(/^\[([x ])\]\s*(.*)$/i);m&&!h?(a.checked="x"===m[1].toLowerCase(),a.children=c(m[2])):a.children=c(d),s.push(a),l++}return{node:{type:"list",ordered:h,items:s},nextIndex:l}}function c(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),i=s.slice(0,t),c=s.slice(t+1);if(i.endsWith(" ")||i.endsWith("\\")){const t=i.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...l(t)),n.push({type:"br"}),s=c,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const i=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(i){n.push({type:"link",url:i[2].trim(),children:l(i[1])}),s=s.slice(i[0].length),e=!0;continue}const c=s.match(/^`([^`]+)`/);if(c){n.push({type:"code",value:c[1]}),s=s.slice(c[0].length),e=!0;continue}const o=s.match(/^(\*\*|__)(.+?)\1/);if(o){n.push({type:"strong",children:l(o[2])}),s=s.slice(o[0].length),e=!0;continue}const r=s.match(/^~~(.+?)~~/);if(r){n.push({type:"del",children:l(r[1])}),s=s.slice(r[0].length),e=!0;continue}const h=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(h){n.push({type:"em",children:l(h[2])}),s=s.slice(h[0].length),e=!0;continue}const u=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(u)n.push({type:"link",url:u[1],children:[{type:"text",value:u[1]}]}),s=s.slice(u[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function l(e,t){return c(e.replace(/\n/g," "))}e.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function o(t,n={}){const s=e(t,n),i=void 0!==n.indent?n.indent:2;return JSON.stringify(s,null,i)}return o.parse=e,o.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=o),"undefined"!=typeof window&&(window.quikdown_json=o),o});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).quikdown_json=t()}(this,function(){"use strict";function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const l=[],o=e.split("\n");let r=0;for(;r<o.length;){const e=o[r];if(""===e.trim()){r++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),i=[];for(r++;r<o.length;){if(o[r].match(/^(```|~~~)\s*$/)){r++;break}i.push(o[r]),r++}l.push({type:"code_block",lang:n||null,content:i.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){l.push({type:"hr"}),r++;continue}const h=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,e,t]=h;l.push({type:"heading",level:e.length,children:c(t)}),r++;continue}if(e.includes("|")){const e=n(o,r);if(e){l.push(e.node),r=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;r<o.length&&o[r].match(/^>\s*/);)e.push(o[r].replace(/^>\s*/,"")),r++;l.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=i(o,r);l.push(e.node),r=e.nextIndex;continue}const u=[];for(;r<o.length;){const e=o[r];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&r+1<o.length&&/^\|?[\s\-:|]+\|?$/.test(o[r+1]))break;u.push(e),r++}u.length>0&&l.push({type:"paragraph",children:c(u.join("\n"))})}return l}function n(e,t,n){if(t+1>=e.length)return null;const i=e[t],l=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(l)||!l.includes("-"))return null;const o=s(i);if(0===o.length)return null;const r=s(l).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),h=o.map(e=>c(e.trim())),u=[];let d=t+2;for(;d<e.length;){const t=e[d];if(!t.includes("|")||""===t.trim())break;const n=s(t);u.push(n.map(e=>c(e.trim()))),d++}return{node:{type:"table",headers:h,rows:u,alignments:r},nextIndex:d}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function i(e,t,n){const s=[];let l=t,o=0;const r=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(r[2]),u=r[1].length;for(;l<e.length&&o<1e3;){o++;const t=e[l].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,r,d]=t,f=n.length;if(f<u)break;const p=/^\d+\./.test(r);if(f===u&&p!==h)break;if(f>u){const t=[];let n=0;for(;l<e.length&&n<1e3;){n++;const s=e[l],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<u)break;if(i[1].length===u)break;t.push(s),l++}if(t.length>0&&s.length>0){const e=i(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const a={type:"list_item",checked:null,children:null},m=d.match(/^\[([x ])\]\s*(.*)$/i);m&&!h?(a.checked="x"===m[1].toLowerCase(),a.children=c(m[2])):a.children=c(d),s.push(a),l++}return{node:{type:"list",ordered:h,items:s},nextIndex:l}}function c(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),i=s.slice(0,t),c=s.slice(t+1);if(i.endsWith(" ")||i.endsWith("\\")){const t=i.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...l(t)),n.push({type:"br"}),s=c,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const i=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(i){n.push({type:"link",url:i[2].trim(),children:l(i[1])}),s=s.slice(i[0].length),e=!0;continue}const c=s.match(/^`([^`]+)`/);if(c){n.push({type:"code",value:c[1]}),s=s.slice(c[0].length),e=!0;continue}const o=s.match(/^(\*\*|__)(.+?)\1/);if(o){n.push({type:"strong",children:l(o[2])}),s=s.slice(o[0].length),e=!0;continue}const r=s.match(/^~~(.+?)~~/);if(r){n.push({type:"del",children:l(r[1])}),s=s.slice(r[0].length),e=!0;continue}const h=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(h){n.push({type:"em",children:l(h[2])}),s=s.slice(h[0].length),e=!0;continue}const u=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(u)n.push({type:"link",url:u[1],children:[{type:"text",value:u[1]}]}),s=s.slice(u[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function l(e,t){return c(e.replace(/\n/g," "))}e.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function o(t,n={}){const s=e(t,n),i=void 0!==n.indent?n.indent:2;return JSON.stringify(s,null,i)}return o.parse=e,o.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=o),"undefined"!=typeof window&&(window.quikdown_json=o),o});
8
8
  //# sourceMappingURL=quikdown_json.umd.min.js.map
Binary file
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * quikdown_yaml - YAML Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  // Version will be injected at build time
18
- const quikdownVersion$1 = '1.2.7';
18
+ const quikdownVersion$1 = '1.2.9';
19
19
 
20
20
  // Safety limit to prevent infinite loops in list parsing
21
21
  const MAX_LOOP_ITERATIONS = 1000;
@@ -520,7 +520,7 @@ if (typeof window !== 'undefined') {
520
520
 
521
521
 
522
522
  // Version will be injected at build time
523
- const quikdownVersion = '1.2.7';
523
+ const quikdownVersion = '1.2.9';
524
524
 
525
525
  /**
526
526
  * Convert markdown to YAML
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * quikdown_yaml - YAML Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  // Version will be injected at build time
16
- const quikdownVersion$1 = '1.2.7';
16
+ const quikdownVersion$1 = '1.2.9';
17
17
 
18
18
  // Safety limit to prevent infinite loops in list parsing
19
19
  const MAX_LOOP_ITERATIONS = 1000;
@@ -518,7 +518,7 @@ if (typeof window !== 'undefined') {
518
518
 
519
519
 
520
520
  // Version will be injected at build time
521
- const quikdownVersion = '1.2.7';
521
+ const quikdownVersion = '1.2.9';
522
522
 
523
523
  /**
524
524
  * Convert markdown to YAML
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * quikdown_yaml - YAML Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
7
- function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const c=[],l=e.split("\n");let o=0;for(;o<l.length;){const e=l[o];if(""===e.trim()){o++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),r=[];for(o++;o<l.length;){if(l[o].match(/^(```|~~~)\s*$/)){o++;break}r.push(l[o]),o++}c.push({type:"code_block",lang:n||null,content:r.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){c.push({type:"hr"}),o++;continue}const u=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,e,t]=u;c.push({type:"heading",level:e.length,children:i(t)}),o++;continue}if(e.includes("|")){const e=n(l,o);if(e){c.push(e.node),o=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;o<l.length&&l[o].match(/^>\s*/);)e.push(l[o].replace(/^>\s*/,"")),o++;c.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=r(l,o);c.push(e.node),o=e.nextIndex;continue}const h=[];for(;o<l.length;){const e=l[o];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&o+1<l.length&&/^\|?[\s\-:|]+\|?$/.test(l[o+1]))break;h.push(e),o++}h.length>0&&c.push({type:"paragraph",children:i(h.join("\n"))})}return c}function n(e,t,n){if(t+1>=e.length)return null;const r=e[t],c=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(c)||!c.includes("-"))return null;const l=s(r);if(0===l.length)return null;const o=s(c).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),u=l.map(e=>i(e.trim())),h=[];let f=t+2;for(;f<e.length;){const t=e[f];if(!t.includes("|")||""===t.trim())break;const n=s(t);h.push(n.map(e=>i(e.trim()))),f++}return{node:{type:"table",headers:u,rows:h,alignments:o},nextIndex:f}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function r(e,t,n){const s=[];let c=t,l=0;const o=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(o[2]),h=o[1].length;for(;c<e.length&&l<1e3;){l++;const t=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,o,f]=t,p=n.length;if(p<h)break;const a=/^\d+\./.test(o);if(p===h&&a!==u)break;if(p>h){const t=[];let n=0;for(;c<e.length&&n<1e3;){n++;const s=e[c],r=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!r)break;if(r[1].length<h)break;if(r[1].length===h)break;t.push(s),c++}if(t.length>0&&s.length>0){const e=r(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const d={type:"list_item",checked:null,children:null},g=f.match(/^\[([x ])\]\s*(.*)$/i);g&&!u?(d.checked="x"===g[1].toLowerCase(),d.children=i(g[2])):d.children=i(f),s.push(d),c++}return{node:{type:"list",ordered:u,items:s},nextIndex:c}}function i(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),r=s.slice(0,t),i=s.slice(t+1);if(r.endsWith(" ")||r.endsWith("\\")){const t=r.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...c(t)),n.push({type:"br"}),s=i,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const r=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(r){n.push({type:"link",url:r[2].trim(),children:c(r[1])}),s=s.slice(r[0].length),e=!0;continue}const i=s.match(/^`([^`]+)`/);if(i){n.push({type:"code",value:i[1]}),s=s.slice(i[0].length),e=!0;continue}const l=s.match(/^(\*\*|__)(.+?)\1/);if(l){n.push({type:"strong",children:c(l[2])}),s=s.slice(l[0].length),e=!0;continue}const o=s.match(/^~~(.+?)~~/);if(o){n.push({type:"del",children:c(o[1])}),s=s.slice(o[0].length),e=!0;continue}const u=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(u){n.push({type:"em",children:c(u[2])}),s=s.slice(u[0].length),e=!0;continue}const h=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(h)n.push({type:"link",url:h[1],children:[{type:"text",value:h[1]}]}),s=s.slice(h[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function c(e,t){return i(e.replace(/\n/g," "))}e.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function l(t,n={}){return o(e(t,n),0)}function o(e,t){const n=" ".repeat(t);if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e)){if(0===e.length)return"[]";const s=[];for(const r of e)if("object"!=typeof r||null===r||Array.isArray(r)){const e=o(r,t+1);s.push(`${n}- ${e}`)}else{const e=Object.entries(r);if(e.length>0){const[r,i]=e[0],c=u(i,t+1);s.push(`${n}- ${r}: ${c}`);for(let r=1;r<e.length;r++){const[i,c]=e[r],l=u(c,t+1);s.push(`${n} ${i}: ${l}`)}}else s.push(`${n}- {}`)}return"\n"+s.join("\n")}if("object"==typeof e){const s=Object.entries(e);if(0===s.length)return"{}";const r=[];for(const[e,i]of s){const s=u(i,t);r.push(`${n}${e}: ${s}`)}return r.join("\n")}return String(e)}function u(e,t){if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e))return 0===e.length?"[]":o(e,t+1);if("object"==typeof e){return 0===Object.entries(e).length?"{}":"\n"+o(e,t+1)}return String(e)}function h(e){if(!(""===e||e.includes("\n")||e.includes(":")||e.includes("#")||e.includes("'")||e.includes('"')||e.startsWith(" ")||e.endsWith(" ")||e.startsWith("-")||e.startsWith("[")||e.startsWith("{")||"true"===e||"false"===e||"null"===e||"yes"===e||"no"===e||"on"===e||"off"===e||/^\d+$/.test(e)||/^\d+\.\d+$/.test(e)))return e;if(e.includes("\n")){return`"${e.replace(/\n/g,"\\n").replace(/"/g,'\\"')}"`}return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}l.parse=e,l.stringify=function(e){return o(e,0)},l.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=l),"undefined"!=typeof window&&(window.quikdown_yaml=l);export{l as default};
7
+ function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const c=[],l=e.split("\n");let o=0;for(;o<l.length;){const e=l[o];if(""===e.trim()){o++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),r=[];for(o++;o<l.length;){if(l[o].match(/^(```|~~~)\s*$/)){o++;break}r.push(l[o]),o++}c.push({type:"code_block",lang:n||null,content:r.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){c.push({type:"hr"}),o++;continue}const u=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,e,t]=u;c.push({type:"heading",level:e.length,children:i(t)}),o++;continue}if(e.includes("|")){const e=n(l,o);if(e){c.push(e.node),o=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;o<l.length&&l[o].match(/^>\s*/);)e.push(l[o].replace(/^>\s*/,"")),o++;c.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=r(l,o);c.push(e.node),o=e.nextIndex;continue}const h=[];for(;o<l.length;){const e=l[o];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&o+1<l.length&&/^\|?[\s\-:|]+\|?$/.test(l[o+1]))break;h.push(e),o++}h.length>0&&c.push({type:"paragraph",children:i(h.join("\n"))})}return c}function n(e,t,n){if(t+1>=e.length)return null;const r=e[t],c=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(c)||!c.includes("-"))return null;const l=s(r);if(0===l.length)return null;const o=s(c).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),u=l.map(e=>i(e.trim())),h=[];let f=t+2;for(;f<e.length;){const t=e[f];if(!t.includes("|")||""===t.trim())break;const n=s(t);h.push(n.map(e=>i(e.trim()))),f++}return{node:{type:"table",headers:u,rows:h,alignments:o},nextIndex:f}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function r(e,t,n){const s=[];let c=t,l=0;const o=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(o[2]),h=o[1].length;for(;c<e.length&&l<1e3;){l++;const t=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,o,f]=t,p=n.length;if(p<h)break;const a=/^\d+\./.test(o);if(p===h&&a!==u)break;if(p>h){const t=[];let n=0;for(;c<e.length&&n<1e3;){n++;const s=e[c],r=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!r)break;if(r[1].length<h)break;if(r[1].length===h)break;t.push(s),c++}if(t.length>0&&s.length>0){const e=r(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const d={type:"list_item",checked:null,children:null},g=f.match(/^\[([x ])\]\s*(.*)$/i);g&&!u?(d.checked="x"===g[1].toLowerCase(),d.children=i(g[2])):d.children=i(f),s.push(d),c++}return{node:{type:"list",ordered:u,items:s},nextIndex:c}}function i(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),r=s.slice(0,t),i=s.slice(t+1);if(r.endsWith(" ")||r.endsWith("\\")){const t=r.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...c(t)),n.push({type:"br"}),s=i,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const r=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(r){n.push({type:"link",url:r[2].trim(),children:c(r[1])}),s=s.slice(r[0].length),e=!0;continue}const i=s.match(/^`([^`]+)`/);if(i){n.push({type:"code",value:i[1]}),s=s.slice(i[0].length),e=!0;continue}const l=s.match(/^(\*\*|__)(.+?)\1/);if(l){n.push({type:"strong",children:c(l[2])}),s=s.slice(l[0].length),e=!0;continue}const o=s.match(/^~~(.+?)~~/);if(o){n.push({type:"del",children:c(o[1])}),s=s.slice(o[0].length),e=!0;continue}const u=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(u){n.push({type:"em",children:c(u[2])}),s=s.slice(u[0].length),e=!0;continue}const h=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(h)n.push({type:"link",url:h[1],children:[{type:"text",value:h[1]}]}),s=s.slice(h[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function c(e,t){return i(e.replace(/\n/g," "))}e.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function l(t,n={}){return o(e(t,n),0)}function o(e,t){const n=" ".repeat(t);if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e)){if(0===e.length)return"[]";const s=[];for(const r of e)if("object"!=typeof r||null===r||Array.isArray(r)){const e=o(r,t+1);s.push(`${n}- ${e}`)}else{const e=Object.entries(r);if(e.length>0){const[r,i]=e[0],c=u(i,t+1);s.push(`${n}- ${r}: ${c}`);for(let r=1;r<e.length;r++){const[i,c]=e[r],l=u(c,t+1);s.push(`${n} ${i}: ${l}`)}}else s.push(`${n}- {}`)}return"\n"+s.join("\n")}if("object"==typeof e){const s=Object.entries(e);if(0===s.length)return"{}";const r=[];for(const[e,i]of s){const s=u(i,t);r.push(`${n}${e}: ${s}`)}return r.join("\n")}return String(e)}function u(e,t){if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e))return 0===e.length?"[]":o(e,t+1);if("object"==typeof e){return 0===Object.entries(e).length?"{}":"\n"+o(e,t+1)}return String(e)}function h(e){if(!(""===e||e.includes("\n")||e.includes(":")||e.includes("#")||e.includes("'")||e.includes('"')||e.startsWith(" ")||e.endsWith(" ")||e.startsWith("-")||e.startsWith("[")||e.startsWith("{")||"true"===e||"false"===e||"null"===e||"yes"===e||"no"===e||"on"===e||"off"===e||/^\d+$/.test(e)||/^\d+\.\d+$/.test(e)))return e;if(e.includes("\n")){return`"${e.replace(/\n/g,"\\n").replace(/"/g,'\\"')}"`}return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}l.parse=e,l.stringify=function(e){return o(e,0)},l.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=l),"undefined"!=typeof window&&(window.quikdown_yaml=l);export{l as default};
8
8
  //# sourceMappingURL=quikdown_yaml.esm.min.js.map
Binary file
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * quikdown_yaml - YAML Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
@@ -19,7 +19,7 @@
19
19
  */
20
20
 
21
21
  // Version will be injected at build time
22
- const quikdownVersion$1 = '1.2.7';
22
+ const quikdownVersion$1 = '1.2.9';
23
23
 
24
24
  // Safety limit to prevent infinite loops in list parsing
25
25
  const MAX_LOOP_ITERATIONS = 1000;
@@ -524,7 +524,7 @@
524
524
 
525
525
 
526
526
  // Version will be injected at build time
527
- const quikdownVersion = '1.2.7';
527
+ const quikdownVersion = '1.2.9';
528
528
 
529
529
  /**
530
530
  * Convert markdown to YAML
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * quikdown_yaml - YAML Markdown Parser
3
- * @version 1.2.7
3
+ * @version 1.2.9
4
4
  * @license BSD-2-Clause
5
5
  * @copyright DeftIO 2025
6
6
  */
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).quikdown_yaml=t()}(this,function(){"use strict";function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const c=[],o=e.split("\n");let l=0;for(;l<o.length;){const e=o[l];if(""===e.trim()){l++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),i=[];for(l++;l<o.length;){if(o[l].match(/^(```|~~~)\s*$/)){l++;break}i.push(o[l]),l++}c.push({type:"code_block",lang:n||null,content:i.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){c.push({type:"hr"}),l++;continue}const u=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,e,t]=u;c.push({type:"heading",level:e.length,children:r(t)}),l++;continue}if(e.includes("|")){const e=n(o,l);if(e){c.push(e.node),l=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;l<o.length&&o[l].match(/^>\s*/);)e.push(o[l].replace(/^>\s*/,"")),l++;c.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=i(o,l);c.push(e.node),l=e.nextIndex;continue}const h=[];for(;l<o.length;){const e=o[l];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&l+1<o.length&&/^\|?[\s\-:|]+\|?$/.test(o[l+1]))break;h.push(e),l++}h.length>0&&c.push({type:"paragraph",children:r(h.join("\n"))})}return c}function n(e,t,n){if(t+1>=e.length)return null;const i=e[t],c=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(c)||!c.includes("-"))return null;const o=s(i);if(0===o.length)return null;const l=s(c).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),u=o.map(e=>r(e.trim())),h=[];let f=t+2;for(;f<e.length;){const t=e[f];if(!t.includes("|")||""===t.trim())break;const n=s(t);h.push(n.map(e=>r(e.trim()))),f++}return{node:{type:"table",headers:u,rows:h,alignments:l},nextIndex:f}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function i(e,t,n){const s=[];let c=t,o=0;const l=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(l[2]),h=l[1].length;for(;c<e.length&&o<1e3;){o++;const t=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,l,f]=t,p=n.length;if(p<h)break;const d=/^\d+\./.test(l);if(p===h&&d!==u)break;if(p>h){const t=[];let n=0;for(;c<e.length&&n<1e3;){n++;const s=e[c],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<h)break;if(i[1].length===h)break;t.push(s),c++}if(t.length>0&&s.length>0){const e=i(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const a={type:"list_item",checked:null,children:null},g=f.match(/^\[([x ])\]\s*(.*)$/i);g&&!u?(a.checked="x"===g[1].toLowerCase(),a.children=r(g[2])):a.children=r(f),s.push(a),c++}return{node:{type:"list",ordered:u,items:s},nextIndex:c}}function r(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),i=s.slice(0,t),r=s.slice(t+1);if(i.endsWith(" ")||i.endsWith("\\")){const t=i.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...c(t)),n.push({type:"br"}),s=r,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const i=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(i){n.push({type:"link",url:i[2].trim(),children:c(i[1])}),s=s.slice(i[0].length),e=!0;continue}const r=s.match(/^`([^`]+)`/);if(r){n.push({type:"code",value:r[1]}),s=s.slice(r[0].length),e=!0;continue}const o=s.match(/^(\*\*|__)(.+?)\1/);if(o){n.push({type:"strong",children:c(o[2])}),s=s.slice(o[0].length),e=!0;continue}const l=s.match(/^~~(.+?)~~/);if(l){n.push({type:"del",children:c(l[1])}),s=s.slice(l[0].length),e=!0;continue}const u=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(u){n.push({type:"em",children:c(u[2])}),s=s.slice(u[0].length),e=!0;continue}const h=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(h)n.push({type:"link",url:h[1],children:[{type:"text",value:h[1]}]}),s=s.slice(h[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function c(e,t){return r(e.replace(/\n/g," "))}e.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function o(t,n={}){return l(e(t,n),0)}function l(e,t){const n=" ".repeat(t);if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e)){if(0===e.length)return"[]";const s=[];for(const i of e)if("object"!=typeof i||null===i||Array.isArray(i)){const e=l(i,t+1);s.push(`${n}- ${e}`)}else{const e=Object.entries(i);if(e.length>0){const[i,r]=e[0],c=u(r,t+1);s.push(`${n}- ${i}: ${c}`);for(let i=1;i<e.length;i++){const[r,c]=e[i],o=u(c,t+1);s.push(`${n} ${r}: ${o}`)}}else s.push(`${n}- {}`)}return"\n"+s.join("\n")}if("object"==typeof e){const s=Object.entries(e);if(0===s.length)return"{}";const i=[];for(const[e,r]of s){const s=u(r,t);i.push(`${n}${e}: ${s}`)}return i.join("\n")}return String(e)}function u(e,t){if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e))return 0===e.length?"[]":l(e,t+1);if("object"==typeof e){return 0===Object.entries(e).length?"{}":"\n"+l(e,t+1)}return String(e)}function h(e){if(!(""===e||e.includes("\n")||e.includes(":")||e.includes("#")||e.includes("'")||e.includes('"')||e.startsWith(" ")||e.endsWith(" ")||e.startsWith("-")||e.startsWith("[")||e.startsWith("{")||"true"===e||"false"===e||"null"===e||"yes"===e||"no"===e||"on"===e||"off"===e||/^\d+$/.test(e)||/^\d+\.\d+$/.test(e)))return e;if(e.includes("\n")){return`"${e.replace(/\n/g,"\\n").replace(/"/g,'\\"')}"`}return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}return o.parse=e,o.stringify=function(e){return l(e,0)},o.version="1.2.7","undefined"!=typeof module&&module.exports&&(module.exports=o),"undefined"!=typeof window&&(window.quikdown_yaml=o),o});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).quikdown_yaml=t()}(this,function(){"use strict";function e(e,n={}){if(!e||"string"!=typeof e)return{type:"document",children:[]};return{type:"document",children:t(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function t(e,s){const c=[],o=e.split("\n");let l=0;for(;l<o.length;){const e=o[l];if(""===e.trim()){l++;continue}const s=e.match(/^(```|~~~)(.*)$/);if(s){const[,e,t]=s,n=t.trim(),i=[];for(l++;l<o.length;){if(o[l].match(/^(```|~~~)\s*$/)){l++;break}i.push(o[l]),l++}c.push({type:"code_block",lang:n||null,content:i.join("\n"),fence:e});continue}if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e)){c.push({type:"hr"}),l++;continue}const u=e.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,e,t]=u;c.push({type:"heading",level:e.length,children:r(t)}),l++;continue}if(e.includes("|")){const e=n(o,l);if(e){c.push(e.node),l=e.nextIndex;continue}}if(e.match(/^>\s*/)){const e=[];for(;l<o.length&&o[l].match(/^>\s*/);)e.push(o[l].replace(/^>\s*/,"")),l++;c.push({type:"blockquote",children:t(e.join("\n"))});continue}if(e.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const e=i(o,l);c.push(e.node),l=e.nextIndex;continue}const h=[];for(;l<o.length;){const e=o[l];if(""===e.trim())break;if(/^(```|~~~)/.test(e))break;if(/^#{1,6}\s/.test(e))break;if(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))break;if(/^>\s*/.test(e))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(e))break;if(e.includes("|")&&l+1<o.length&&/^\|?[\s\-:|]+\|?$/.test(o[l+1]))break;h.push(e),l++}h.length>0&&c.push({type:"paragraph",children:r(h.join("\n"))})}return c}function n(e,t,n){if(t+1>=e.length)return null;const i=e[t],c=e[t+1];if(!/^\|?[\s\-:|]+\|?$/.test(c)||!c.includes("-"))return null;const o=s(i);if(0===o.length)return null;const l=s(c).map(e=>{const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left"}),u=o.map(e=>r(e.trim())),h=[];let f=t+2;for(;f<e.length;){const t=e[f];if(!t.includes("|")||""===t.trim())break;const n=s(t);h.push(n.map(e=>r(e.trim()))),f++}return{node:{type:"table",headers:u,rows:h,alignments:l},nextIndex:f}}function s(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|")}function i(e,t,n){const s=[];let c=t,o=0;const l=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(l[2]),h=l[1].length;for(;c<e.length&&o<1e3;){o++;const t=e[c].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!t)break;const[,n,l,f]=t,p=n.length;if(p<h)break;const d=/^\d+\./.test(l);if(p===h&&d!==u)break;if(p>h){const t=[];let n=0;for(;c<e.length&&n<1e3;){n++;const s=e[c],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<h)break;if(i[1].length===h)break;t.push(s),c++}if(t.length>0&&s.length>0){const e=i(t,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(e.node)}continue}const a={type:"list_item",checked:null,children:null},g=f.match(/^\[([x ])\]\s*(.*)$/i);g&&!u?(a.checked="x"===g[1].toLowerCase(),a.children=r(g[2])):a.children=r(f),s.push(a),c++}return{node:{type:"list",ordered:u,items:s},nextIndex:c}}function r(e,t){if(!e)return[];const n=[];let s=e;for(;s.length>0;){let e=!1;if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const t=s.indexOf("\n"),i=s.slice(0,t),r=s.slice(t+1);if(i.endsWith(" ")||i.endsWith("\\")){const t=i.replace(/\\$/,"").replace(/ +$/,"");t&&n.push(...c(t)),n.push({type:"br"}),s=r,e=!0;continue}}const t=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"image",alt:t[1],url:t[2].trim()}),s=s.slice(t[0].length),e=!0;continue}const i=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(i){n.push({type:"link",url:i[2].trim(),children:c(i[1])}),s=s.slice(i[0].length),e=!0;continue}const r=s.match(/^`([^`]+)`/);if(r){n.push({type:"code",value:r[1]}),s=s.slice(r[0].length),e=!0;continue}const o=s.match(/^(\*\*|__)(.+?)\1/);if(o){n.push({type:"strong",children:c(o[2])}),s=s.slice(o[0].length),e=!0;continue}const l=s.match(/^~~(.+?)~~/);if(l){n.push({type:"del",children:c(l[1])}),s=s.slice(l[0].length),e=!0;continue}const u=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(u){n.push({type:"em",children:c(u[2])}),s=s.slice(u[0].length),e=!0;continue}const h=s.match(/^(https?:\/\/[^\s<>[\]]+)/);if(h)n.push({type:"link",url:h[1],children:[{type:"text",value:h[1]}]}),s=s.slice(h[0].length),e=!0;else if(!e){const e=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===e){n.push({type:"text",value:s});break}0===e?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,e)}),s=s.slice(e))}}return function(e){const t=[];for(const n of e)"text"===n.type&&t.length>0&&"text"===t[t.length-1].type?t[t.length-1].value+=n.value:t.push(n);return t}(n)}function c(e,t){return r(e.replace(/\n/g," "))}e.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof window&&(window.quikdown_ast=e);function o(t,n={}){return l(e(t,n),0)}function l(e,t){const n=" ".repeat(t);if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e)){if(0===e.length)return"[]";const s=[];for(const i of e)if("object"!=typeof i||null===i||Array.isArray(i)){const e=l(i,t+1);s.push(`${n}- ${e}`)}else{const e=Object.entries(i);if(e.length>0){const[i,r]=e[0],c=u(r,t+1);s.push(`${n}- ${i}: ${c}`);for(let i=1;i<e.length;i++){const[r,c]=e[i],o=u(c,t+1);s.push(`${n} ${r}: ${o}`)}}else s.push(`${n}- {}`)}return"\n"+s.join("\n")}if("object"==typeof e){const s=Object.entries(e);if(0===s.length)return"{}";const i=[];for(const[e,r]of s){const s=u(r,t);i.push(`${n}${e}: ${s}`)}return i.join("\n")}return String(e)}function u(e,t){if(null==e)return"null";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return String(e);if("string"==typeof e)return h(e);if(Array.isArray(e))return 0===e.length?"[]":l(e,t+1);if("object"==typeof e){return 0===Object.entries(e).length?"{}":"\n"+l(e,t+1)}return String(e)}function h(e){if(!(""===e||e.includes("\n")||e.includes(":")||e.includes("#")||e.includes("'")||e.includes('"')||e.startsWith(" ")||e.endsWith(" ")||e.startsWith("-")||e.startsWith("[")||e.startsWith("{")||"true"===e||"false"===e||"null"===e||"yes"===e||"no"===e||"on"===e||"off"===e||/^\d+$/.test(e)||/^\d+\.\d+$/.test(e)))return e;if(e.includes("\n")){return`"${e.replace(/\n/g,"\\n").replace(/"/g,'\\"')}"`}return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}return o.parse=e,o.stringify=function(e){return l(e,0)},o.version="1.2.9","undefined"!=typeof module&&module.exports&&(module.exports=o),"undefined"!=typeof window&&(window.quikdown_yaml=o),o});
8
8
  //# sourceMappingURL=quikdown_yaml.umd.min.js.map
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quikdown",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "quikdown is a simple markdown to HTML parser that supports fences",
5
5
  "author": "deftio (https://github.com/deftio",
6
6
  "license": "BSD-2-Clause",
@@ -102,6 +102,7 @@
102
102
  "test:coverage": "NODE_NO_WARNINGS=1 jest tests/quikdown.test.js tests/quikdown_bd.test.js tests/quikdown_edit_esm.test.js --coverage --coverageReporters=text-summary",
103
103
  "test:unit": "jest --coverage",
104
104
  "test:e2e": "npx playwright test --config=playwright.config.cjs",
105
+ "test:e2e:full": "npx playwright test --config=playwright.config.cjs",
105
106
  "test:editor:e2e": "npx playwright test tests/quikdown-editor.spec.js",
106
107
  "minifyCSS": "node ./tools/minifyCSS.cjs",
107
108
  "updateVersion": "node ./tools/updateVersion",
@@ -110,15 +111,14 @@
110
111
  "release": "bash ./tools/release.sh",
111
112
  "release:legacy": "node ./tools/createRelease.js",
112
113
  "tag": "./tools/createTag.sh",
113
- "buildDocs": "node ./tools/buildDocs.js",
114
- "docs:api": "npx jsdoc src/quikchat.js -d docs/api",
115
- "updateExampleCopies": "cp dist/quikchat.umd.min.js examples/fastapi_llm/static && cp dist/quikchat.min.css examples/fastapi_llm/static && cp dist/quikchat.umd.min.js examples/npm_express/static && cp dist/quikchat.min.css examples/npm_express/static",
116
- "build": "npm run lint && npm run updateVersion && rollup -c && npm run css && npm run sizes && npm run updateBadges && npm run buildDocs && npm run buildSite",
114
+ "docs:api": "npx jsdoc src/quikdown.js -d docs/api",
115
+ "build": "npm run lint && npm run updateVersion && rollup -c && npm run css && npm run sizes && npm run updateBadges && npm run buildSite",
116
+ "dev": "npx bwcli serve . -p 6811",
117
117
  "serve": "npx bwcli serve . -p 6811",
118
118
  "buildSite": "node ./tools/buildSite.js",
119
- "build:all": "npm run build",
119
+ "build:standalone": "rollup -c rollup.config.standalone.js",
120
+ "build:all": "npm run build && npm run build:standalone",
120
121
  "build:css": "node tools/generateThemeCSS.js",
121
- "build:docs": "node ./tools/buildDocs.js",
122
122
  "minify:css": "node tools/minifyThemeCSS.js",
123
123
  "css": "npm run build:css && npm run minify:css",
124
124
  "test:perf": "node tests/performance-benchmark.js",
@@ -174,10 +174,10 @@
174
174
  "statements": 100
175
175
  },
176
176
  "./dist/quikdown_edit.esm.js": {
177
- "lines": 29,
178
- "functions": 39,
179
- "branches": 24,
180
- "statements": 29
177
+ "lines": 49,
178
+ "functions": 57,
179
+ "branches": 42,
180
+ "statements": 49
181
181
  },
182
182
  "./dist/quikdown_ast.esm.js": {
183
183
  "lines": 95,
@@ -216,22 +216,27 @@
216
216
  "@rollup/plugin-node-resolve": "^16.0.3",
217
217
  "@rollup/plugin-terser": "^1.0.0",
218
218
  "babel-jest": "^30.3.0",
219
- "bitwrench": "^2.0.25",
219
+ "bitwrench": "^2.0.31",
220
220
  "clean-css": "^5.3.3",
221
221
  "clean-css-cli": "^5.6.3",
222
- "coveralls": "^3.1.1",
223
222
  "cssnano": "^7.1.4",
224
223
  "docbat": "^0.9.3",
224
+ "dompurify": "^3.3.3",
225
225
  "eslint": "^9.39.4",
226
+ "eslint-plugin-security": "^4.0.0",
226
227
  "globals": "^17.4.0",
227
228
  "husky": "^9.1.7",
228
229
  "jest": "^30.3.0",
229
230
  "jest-environment-jsdom": "^30.3.0",
230
231
  "jsdom": "^26.1.0",
232
+ "leaflet": "^1.9.4",
233
+ "mermaid": "^11.14.0",
231
234
  "playwright": "^1.59.1",
232
235
  "rollup": "^4.60.1",
233
236
  "rollup-plugin-css-only": "^4.5.5",
237
+ "rollup-plugin-polyfill-node": "^0.13.0",
234
238
  "rollup-plugin-postcss": "^4.0.2",
239
+ "three": "^0.183.2",
235
240
  "typescript": "^6.0.2"
236
241
  }
237
242
  }