quikdown 1.2.17 → 1.2.19
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 +130 -30
- package/dist/quikdown-airgap-v1.2.19.zip +0 -0
- package/dist/quikdown.cjs +2 -2
- package/dist/quikdown.dark.css +1 -1
- package/dist/quikdown.esm.js +2 -2
- package/dist/quikdown.esm.min.js +2 -2
- package/dist/quikdown.esm.min.js.gz +0 -0
- package/dist/quikdown.light.css +1 -1
- package/dist/quikdown.umd.js +2 -2
- package/dist/quikdown.umd.min.js +2 -2
- package/dist/quikdown.umd.min.js.gz +0 -0
- package/dist/quikdown_ast.cjs +2 -2
- package/dist/quikdown_ast.esm.js +2 -2
- package/dist/quikdown_ast.esm.min.js +2 -2
- package/dist/quikdown_ast.esm.min.js.gz +0 -0
- package/dist/quikdown_ast.umd.js +2 -2
- package/dist/quikdown_ast.umd.min.js +2 -2
- package/dist/quikdown_ast.umd.min.js.gz +0 -0
- package/dist/quikdown_ast_html.cjs +3 -3
- package/dist/quikdown_ast_html.esm.js +3 -3
- package/dist/quikdown_ast_html.esm.min.js +2 -2
- package/dist/quikdown_ast_html.esm.min.js.gz +0 -0
- package/dist/quikdown_ast_html.umd.js +3 -3
- package/dist/quikdown_ast_html.umd.min.js +2 -2
- package/dist/quikdown_ast_html.umd.min.js.gz +0 -0
- package/dist/quikdown_bd.cjs +2 -2
- package/dist/quikdown_bd.esm.js +2 -2
- package/dist/quikdown_bd.esm.min.js +2 -2
- package/dist/quikdown_bd.esm.min.js.gz +0 -0
- package/dist/quikdown_bd.umd.js +2 -2
- package/dist/quikdown_bd.umd.min.js +2 -2
- package/dist/quikdown_bd.umd.min.js.gz +0 -0
- package/dist/quikdown_edit.cjs +3 -3
- package/dist/quikdown_edit.esm.js +3 -3
- package/dist/quikdown_edit.esm.min.js +3 -3
- package/dist/quikdown_edit.esm.min.js.gz +0 -0
- package/dist/quikdown_edit.umd.js +3 -3
- package/dist/quikdown_edit.umd.min.js +3 -3
- package/dist/quikdown_edit.umd.min.js.gz +0 -0
- package/dist/quikdown_edit_standalone.esm.js +3 -3
- package/dist/quikdown_edit_standalone.esm.min.js +1 -1
- package/dist/quikdown_edit_standalone.esm.min.js.gz +0 -0
- package/dist/quikdown_edit_standalone.umd.js +3 -3
- package/dist/quikdown_edit_standalone.umd.min.js +1 -1
- package/dist/quikdown_edit_standalone.umd.min.js.gz +0 -0
- package/dist/quikdown_json.cjs +3 -3
- package/dist/quikdown_json.esm.js +3 -3
- package/dist/quikdown_json.esm.min.js +2 -2
- package/dist/quikdown_json.esm.min.js.gz +0 -0
- package/dist/quikdown_json.umd.js +3 -3
- package/dist/quikdown_json.umd.min.js +2 -2
- package/dist/quikdown_json.umd.min.js.gz +0 -0
- package/dist/quikdown_mcp.cjs +2 -2
- package/dist/quikdown_mcp.esm.js +2 -2
- package/dist/quikdown_yaml.cjs +3 -3
- package/dist/quikdown_yaml.esm.js +3 -3
- package/dist/quikdown_yaml.esm.min.js +2 -2
- package/dist/quikdown_yaml.esm.min.js.gz +0 -0
- package/dist/quikdown_yaml.umd.js +3 -3
- package/dist/quikdown_yaml.umd.min.js +2 -2
- package/dist/quikdown_yaml.umd.min.js.gz +0 -0
- package/package.json +14 -3
|
Binary file
|
package/dist/quikdown_json.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_json - JSON Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
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.
|
|
18
|
+
const quikdownVersion$1 = '1.2.19';
|
|
19
19
|
|
|
20
20
|
// Safety limit to prevent infinite loops in list parsing
|
|
21
21
|
const MAX_LOOP_ITERATIONS = 1000;
|
|
@@ -612,7 +612,7 @@ if (typeof window !== 'undefined') {
|
|
|
612
612
|
|
|
613
613
|
|
|
614
614
|
// Version will be injected at build time
|
|
615
|
-
const quikdownVersion = '1.2.
|
|
615
|
+
const quikdownVersion = '1.2.19';
|
|
616
616
|
|
|
617
617
|
/**
|
|
618
618
|
* Convert markdown to JSON
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_json - JSON Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
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.
|
|
16
|
+
const quikdownVersion$1 = '1.2.19';
|
|
17
17
|
|
|
18
18
|
// Safety limit to prevent infinite loops in list parsing
|
|
19
19
|
const MAX_LOOP_ITERATIONS = 1000;
|
|
@@ -610,7 +610,7 @@ if (typeof window !== 'undefined') {
|
|
|
610
610
|
|
|
611
611
|
|
|
612
612
|
// Version will be injected at build time
|
|
613
|
-
const quikdownVersion = '1.2.
|
|
613
|
+
const quikdownVersion = '1.2.19';
|
|
614
614
|
|
|
615
615
|
/**
|
|
616
616
|
* Convert markdown to JSON
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_json - JSON Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
4
4
|
* @license BSD-2-Clause
|
|
5
5
|
* @copyright DeftIO 2025
|
|
6
6
|
*/
|
|
7
|
-
function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const l=[],r=t.split("\n");let h=0;for(;h<r.length;){const t=r[h];if(""===t.trim()){h++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),i=[];for(h++;h<r.length;){if(r[h].match(/^(```|~~~)\s*$/)){h++;break}i.push(r[h]),h++}l.push({type:"code_block",lang:s||null,content:i.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){l.push({type:"hr"}),h++;continue}const u=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,t,e]=u;l.push({type:"heading",level:t.length,children:o(e)}),h++;continue}if(t.includes("|")){const t=i(r,h);if(t){l.push(t.node),h=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;h<r.length;)if(r[h].match(/^>\s*/))t.push(r[h].replace(/^>\s*/,"")),n=!0,h++;else{if(!n||e(r[h]))break;t.push(r[h]),h++}const i=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(i){const e=i[1].toLowerCase();l.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else l.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=c(r,h);l.push(t.node),h=t.nextIndex;continue}const a=[];for(;h<r.length;){const t=r[h];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&h+1<r.length&&/^\|?[\s\-:|]+\|?$/.test(r[h+1]))break;a.push(t),h++}a.length>0&&l.push({type:"paragraph",children:o(a.join("\n"))})}return l}function i(t,e,n){if(e+1>=t.length)return null;const s=t[e],i=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(i)||!i.includes("-"))return null;const c=l(s);if(0===c.length)return null;const r=l(i).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),h=r.length,u=[];for(let t=0;t<h;t++){const e=t<c.length?c[t]:"";u.push(o(e.trim()))}const a=[];let p=e+2;for(;p<t.length;){const e=t[p];if(!e.includes("|")||""===e.trim())break;const n=l(e),s=[];for(let t=0;t<h;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}a.push(s),p++}return{node:{type:"table",headers:u,rows:a,alignments:r},nextIndex:p}}function l(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function c(t,e,n){const s=[];let i=e,l=0;const r=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(r[2]),u=r[1].length;for(;i<t.length&&l<1e3;){l++;const e=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,r,a]=e,p=n.length;if(p<u)break;const f=/^\d+\./.test(r);if(p===u&&f!==h)break;if(p>u){const e=[];let n=0;for(;i<t.length&&n<1e3;){n++;const s=t[i],l=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!l)break;if(l[1].length<u)break;if(l[1].length===u)break;e.push(s),i++}if(e.length>0&&s.length>0){const t=c(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.node)}continue}const d={type:"list_item",checked:null,children:null},g=a.match(/^\[([x ])\]\s*(.*)$/i);g&&!h?(d.checked="x"===g[1].toLowerCase(),d.children=o(g[2])):d.children=o(a),s.push(d),i++}return{node:{type:"list",ordered:h,items:s},nextIndex:i}}function r(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let i=t;for(;i.length>0;){if(i.match(/^(.+?)(?: {2}|\\\n|\n)/)&&i.includes("\n")){const t=i.indexOf("\n"),e=i.slice(0,t),n=i.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...h(t)),s.push({type:"br"}),i=n;continue}}const e=i.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=r(e[2]),l={type:"image",alt:e[1],url:t.trim()};n&&(l.title=n),s.push(l),i=i.slice(e[0].length);continue}const l=i.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(l){const{url:t,title:e}=r(l[2]),n={type:"link",url:t.trim(),children:h(l[1])};e&&(n.title=e),s.push(n),i=i.slice(l[0].length);continue}const c=i.match(/^`([^`\n]+)`/);if(c){s.push({type:"code",value:c[1]}),i=i.slice(c[0].length);continue}const o=i.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:h(o[2])}),i=i.slice(o[0].length);continue}const u=i.match(/^~~(.+?)~~/);if(u){s.push({type:"del",children:h(u[1])}),i=i.slice(u[0].length);continue}const a=t[t.length-i.length-1]||"",p=!/[A-Za-z0-9_]/.test(a),f=i.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||p&&i.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(f){s.push({type:"em",children:h(f[1])}),i=i.slice(f[0].length);continue}const d=i.match(/^(https?:\/\/[^\s<>[\]]+)/);if(d){const{url:t,trailing:e}=n(d[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),i=i.slice(d[0].length);continue}const g=i.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:i});break}0===g?(s.push({type:"text",value:i[0]}),i=i.slice(1)):(s.push({type:"text",value:i.slice(0,g)}),i=i.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function h(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.
|
|
7
|
+
function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const l=[],r=t.split("\n");let h=0;for(;h<r.length;){const t=r[h];if(""===t.trim()){h++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),i=[];for(h++;h<r.length;){if(r[h].match(/^(```|~~~)\s*$/)){h++;break}i.push(r[h]),h++}l.push({type:"code_block",lang:s||null,content:i.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){l.push({type:"hr"}),h++;continue}const u=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,t,e]=u;l.push({type:"heading",level:t.length,children:o(e)}),h++;continue}if(t.includes("|")){const t=i(r,h);if(t){l.push(t.node),h=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;h<r.length;)if(r[h].match(/^>\s*/))t.push(r[h].replace(/^>\s*/,"")),n=!0,h++;else{if(!n||e(r[h]))break;t.push(r[h]),h++}const i=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(i){const e=i[1].toLowerCase();l.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else l.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=c(r,h);l.push(t.node),h=t.nextIndex;continue}const a=[];for(;h<r.length;){const t=r[h];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&h+1<r.length&&/^\|?[\s\-:|]+\|?$/.test(r[h+1]))break;a.push(t),h++}a.length>0&&l.push({type:"paragraph",children:o(a.join("\n"))})}return l}function i(t,e,n){if(e+1>=t.length)return null;const s=t[e],i=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(i)||!i.includes("-"))return null;const c=l(s);if(0===c.length)return null;const r=l(i).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),h=r.length,u=[];for(let t=0;t<h;t++){const e=t<c.length?c[t]:"";u.push(o(e.trim()))}const a=[];let p=e+2;for(;p<t.length;){const e=t[p];if(!e.includes("|")||""===e.trim())break;const n=l(e),s=[];for(let t=0;t<h;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}a.push(s),p++}return{node:{type:"table",headers:u,rows:a,alignments:r},nextIndex:p}}function l(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function c(t,e,n){const s=[];let i=e,l=0;const r=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(r[2]),u=r[1].length;for(;i<t.length&&l<1e3;){l++;const e=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,r,a]=e,p=n.length;if(p<u)break;const f=/^\d+\./.test(r);if(p===u&&f!==h)break;if(p>u){const e=[];let n=0;for(;i<t.length&&n<1e3;){n++;const s=t[i],l=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!l)break;if(l[1].length<u)break;if(l[1].length===u)break;e.push(s),i++}if(e.length>0&&s.length>0){const t=c(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.node)}continue}const d={type:"list_item",checked:null,children:null},g=a.match(/^\[([x ])\]\s*(.*)$/i);g&&!h?(d.checked="x"===g[1].toLowerCase(),d.children=o(g[2])):d.children=o(a),s.push(d),i++}return{node:{type:"list",ordered:h,items:s},nextIndex:i}}function r(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let i=t;for(;i.length>0;){if(i.match(/^(.+?)(?: {2}|\\\n|\n)/)&&i.includes("\n")){const t=i.indexOf("\n"),e=i.slice(0,t),n=i.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...h(t)),s.push({type:"br"}),i=n;continue}}const e=i.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=r(e[2]),l={type:"image",alt:e[1],url:t.trim()};n&&(l.title=n),s.push(l),i=i.slice(e[0].length);continue}const l=i.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(l){const{url:t,title:e}=r(l[2]),n={type:"link",url:t.trim(),children:h(l[1])};e&&(n.title=e),s.push(n),i=i.slice(l[0].length);continue}const c=i.match(/^`([^`\n]+)`/);if(c){s.push({type:"code",value:c[1]}),i=i.slice(c[0].length);continue}const o=i.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:h(o[2])}),i=i.slice(o[0].length);continue}const u=i.match(/^~~(.+?)~~/);if(u){s.push({type:"del",children:h(u[1])}),i=i.slice(u[0].length);continue}const a=t[t.length-i.length-1]||"",p=!/[A-Za-z0-9_]/.test(a),f=i.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||p&&i.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(f){s.push({type:"em",children:h(f[1])}),i=i.slice(f[0].length);continue}const d=i.match(/^(https?:\/\/[^\s<>[\]]+)/);if(d){const{url:t,trailing:e}=n(d[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),i=i.slice(d[0].length);continue}const g=i.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:i});break}0===g?(s.push({type:"text",value:i[0]}),i=i.slice(1)):(s.push({type:"text",value:i.slice(0,g)}),i=i.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function h(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof window&&(window.quikdown_ast=t);function u(e,n={}){const s=t(e,n),i=void 0!==n.indent?n.indent:2;return JSON.stringify(s,null,i)}u.parse=t,u.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=u),"undefined"!=typeof window&&(window.quikdown_json=u);export{u 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.
|
|
3
|
+
* @version 1.2.19
|
|
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.
|
|
22
|
+
const quikdownVersion$1 = '1.2.19';
|
|
23
23
|
|
|
24
24
|
// Safety limit to prevent infinite loops in list parsing
|
|
25
25
|
const MAX_LOOP_ITERATIONS = 1000;
|
|
@@ -616,7 +616,7 @@
|
|
|
616
616
|
|
|
617
617
|
|
|
618
618
|
// Version will be injected at build time
|
|
619
|
-
const quikdownVersion = '1.2.
|
|
619
|
+
const quikdownVersion = '1.2.19';
|
|
620
620
|
|
|
621
621
|
/**
|
|
622
622
|
* Convert markdown to JSON
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_json - JSON Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
4
4
|
* @license BSD-2-Clause
|
|
5
5
|
* @copyright DeftIO 2025
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).quikdown_json=e()}(this,function(){"use strict";function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const l=[],r=t.split("\n");let h=0;for(;h<r.length;){const t=r[h];if(""===t.trim()){h++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),i=[];for(h++;h<r.length;){if(r[h].match(/^(```|~~~)\s*$/)){h++;break}i.push(r[h]),h++}l.push({type:"code_block",lang:s||null,content:i.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){l.push({type:"hr"}),h++;continue}const u=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,t,e]=u;l.push({type:"heading",level:t.length,children:o(e)}),h++;continue}if(t.includes("|")){const t=i(r,h);if(t){l.push(t.node),h=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;h<r.length;)if(r[h].match(/^>\s*/))t.push(r[h].replace(/^>\s*/,"")),n=!0,h++;else{if(!n||e(r[h]))break;t.push(r[h]),h++}const i=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(i){const e=i[1].toLowerCase();l.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else l.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=c(r,h);l.push(t.node),h=t.nextIndex;continue}const f=[];for(;h<r.length;){const t=r[h];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&h+1<r.length&&/^\|?[\s\-:|]+\|?$/.test(r[h+1]))break;f.push(t),h++}f.length>0&&l.push({type:"paragraph",children:o(f.join("\n"))})}return l}function i(t,e,n){if(e+1>=t.length)return null;const s=t[e],i=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(i)||!i.includes("-"))return null;const c=l(s);if(0===c.length)return null;const r=l(i).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),h=r.length,u=[];for(let t=0;t<h;t++){const e=t<c.length?c[t]:"";u.push(o(e.trim()))}const f=[];let d=e+2;for(;d<t.length;){const e=t[d];if(!e.includes("|")||""===e.trim())break;const n=l(e),s=[];for(let t=0;t<h;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}f.push(s),d++}return{node:{type:"table",headers:u,rows:f,alignments:r},nextIndex:d}}function l(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function c(t,e,n){const s=[];let i=e,l=0;const r=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(r[2]),u=r[1].length;for(;i<t.length&&l<1e3;){l++;const e=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,r,f]=e,d=n.length;if(d<u)break;const p=/^\d+\./.test(r);if(d===u&&p!==h)break;if(d>u){const e=[];let n=0;for(;i<t.length&&n<1e3;){n++;const s=t[i],l=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!l)break;if(l[1].length<u)break;if(l[1].length===u)break;e.push(s),i++}if(e.length>0&&s.length>0){const t=c(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.node)}continue}const a={type:"list_item",checked:null,children:null},g=f.match(/^\[([x ])\]\s*(.*)$/i);g&&!h?(a.checked="x"===g[1].toLowerCase(),a.children=o(g[2])):a.children=o(f),s.push(a),i++}return{node:{type:"list",ordered:h,items:s},nextIndex:i}}function r(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let i=t;for(;i.length>0;){if(i.match(/^(.+?)(?: {2}|\\\n|\n)/)&&i.includes("\n")){const t=i.indexOf("\n"),e=i.slice(0,t),n=i.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...h(t)),s.push({type:"br"}),i=n;continue}}const e=i.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=r(e[2]),l={type:"image",alt:e[1],url:t.trim()};n&&(l.title=n),s.push(l),i=i.slice(e[0].length);continue}const l=i.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(l){const{url:t,title:e}=r(l[2]),n={type:"link",url:t.trim(),children:h(l[1])};e&&(n.title=e),s.push(n),i=i.slice(l[0].length);continue}const c=i.match(/^`([^`\n]+)`/);if(c){s.push({type:"code",value:c[1]}),i=i.slice(c[0].length);continue}const o=i.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:h(o[2])}),i=i.slice(o[0].length);continue}const u=i.match(/^~~(.+?)~~/);if(u){s.push({type:"del",children:h(u[1])}),i=i.slice(u[0].length);continue}const f=t[t.length-i.length-1]||"",d=!/[A-Za-z0-9_]/.test(f),p=i.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||d&&i.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(p){s.push({type:"em",children:h(p[1])}),i=i.slice(p[0].length);continue}const a=i.match(/^(https?:\/\/[^\s<>[\]]+)/);if(a){const{url:t,trailing:e}=n(a[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),i=i.slice(a[0].length);continue}const g=i.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:i});break}0===g?(s.push({type:"text",value:i[0]}),i=i.slice(1)):(s.push({type:"text",value:i.slice(0,g)}),i=i.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function h(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).quikdown_json=e()}(this,function(){"use strict";function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const l=[],r=t.split("\n");let h=0;for(;h<r.length;){const t=r[h];if(""===t.trim()){h++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),i=[];for(h++;h<r.length;){if(r[h].match(/^(```|~~~)\s*$/)){h++;break}i.push(r[h]),h++}l.push({type:"code_block",lang:s||null,content:i.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){l.push({type:"hr"}),h++;continue}const u=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(u){const[,t,e]=u;l.push({type:"heading",level:t.length,children:o(e)}),h++;continue}if(t.includes("|")){const t=i(r,h);if(t){l.push(t.node),h=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;h<r.length;)if(r[h].match(/^>\s*/))t.push(r[h].replace(/^>\s*/,"")),n=!0,h++;else{if(!n||e(r[h]))break;t.push(r[h]),h++}const i=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(i){const e=i[1].toLowerCase();l.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else l.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=c(r,h);l.push(t.node),h=t.nextIndex;continue}const f=[];for(;h<r.length;){const t=r[h];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&h+1<r.length&&/^\|?[\s\-:|]+\|?$/.test(r[h+1]))break;f.push(t),h++}f.length>0&&l.push({type:"paragraph",children:o(f.join("\n"))})}return l}function i(t,e,n){if(e+1>=t.length)return null;const s=t[e],i=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(i)||!i.includes("-"))return null;const c=l(s);if(0===c.length)return null;const r=l(i).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),h=r.length,u=[];for(let t=0;t<h;t++){const e=t<c.length?c[t]:"";u.push(o(e.trim()))}const f=[];let d=e+2;for(;d<t.length;){const e=t[d];if(!e.includes("|")||""===e.trim())break;const n=l(e),s=[];for(let t=0;t<h;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}f.push(s),d++}return{node:{type:"table",headers:u,rows:f,alignments:r},nextIndex:d}}function l(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function c(t,e,n){const s=[];let i=e,l=0;const r=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),h=/^\d+\./.test(r[2]),u=r[1].length;for(;i<t.length&&l<1e3;){l++;const e=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,r,f]=e,d=n.length;if(d<u)break;const p=/^\d+\./.test(r);if(d===u&&p!==h)break;if(d>u){const e=[];let n=0;for(;i<t.length&&n<1e3;){n++;const s=t[i],l=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!l)break;if(l[1].length<u)break;if(l[1].length===u)break;e.push(s),i++}if(e.length>0&&s.length>0){const t=c(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.node)}continue}const a={type:"list_item",checked:null,children:null},g=f.match(/^\[([x ])\]\s*(.*)$/i);g&&!h?(a.checked="x"===g[1].toLowerCase(),a.children=o(g[2])):a.children=o(f),s.push(a),i++}return{node:{type:"list",ordered:h,items:s},nextIndex:i}}function r(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let i=t;for(;i.length>0;){if(i.match(/^(.+?)(?: {2}|\\\n|\n)/)&&i.includes("\n")){const t=i.indexOf("\n"),e=i.slice(0,t),n=i.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...h(t)),s.push({type:"br"}),i=n;continue}}const e=i.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=r(e[2]),l={type:"image",alt:e[1],url:t.trim()};n&&(l.title=n),s.push(l),i=i.slice(e[0].length);continue}const l=i.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(l){const{url:t,title:e}=r(l[2]),n={type:"link",url:t.trim(),children:h(l[1])};e&&(n.title=e),s.push(n),i=i.slice(l[0].length);continue}const c=i.match(/^`([^`\n]+)`/);if(c){s.push({type:"code",value:c[1]}),i=i.slice(c[0].length);continue}const o=i.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:h(o[2])}),i=i.slice(o[0].length);continue}const u=i.match(/^~~(.+?)~~/);if(u){s.push({type:"del",children:h(u[1])}),i=i.slice(u[0].length);continue}const f=t[t.length-i.length-1]||"",d=!/[A-Za-z0-9_]/.test(f),p=i.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||d&&i.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(p){s.push({type:"em",children:h(p[1])}),i=i.slice(p[0].length);continue}const a=i.match(/^(https?:\/\/[^\s<>[\]]+)/);if(a){const{url:t,trailing:e}=n(a[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),i=i.slice(a[0].length);continue}const g=i.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:i});break}0===g?(s.push({type:"text",value:i[0]}),i=i.slice(1)):(s.push({type:"text",value:i.slice(0,g)}),i=i.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function h(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof window&&(window.quikdown_ast=t);function u(e,n={}){const s=t(e,n),i=void 0!==n.indent?n.indent:2;return JSON.stringify(s,null,i)}return u.parse=t,u.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=u),"undefined"!=typeof window&&(window.quikdown_json=u),u});
|
|
8
8
|
//# sourceMappingURL=quikdown_json.umd.min.js.map
|
|
Binary file
|
package/dist/quikdown_mcp.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_mcp - MCP Server Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
4
4
|
* @license BSD-2-Clause
|
|
5
5
|
* @copyright DeftIO 2025
|
|
6
6
|
*/
|
|
@@ -19,7 +19,7 @@ var nodeReadline = require('readline');
|
|
|
19
19
|
// Auto-generated version file - DO NOT EDIT MANUALLY
|
|
20
20
|
// This file is automatically updated by tools/updateVersion.js
|
|
21
21
|
|
|
22
|
-
const quikdownVersion = "1.2.
|
|
22
|
+
const quikdownVersion = "1.2.19";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* quikdown_mcp — MCP (Model Context Protocol) server for quikdown
|
package/dist/quikdown_mcp.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_mcp - MCP Server Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
4
4
|
* @license BSD-2-Clause
|
|
5
5
|
* @copyright DeftIO 2025
|
|
6
6
|
*/
|
|
@@ -15,7 +15,7 @@ import nodeReadline from 'readline';
|
|
|
15
15
|
// Auto-generated version file - DO NOT EDIT MANUALLY
|
|
16
16
|
// This file is automatically updated by tools/updateVersion.js
|
|
17
17
|
|
|
18
|
-
const quikdownVersion = "1.2.
|
|
18
|
+
const quikdownVersion = "1.2.19";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* quikdown_mcp — MCP (Model Context Protocol) server for quikdown
|
package/dist/quikdown_yaml.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_yaml - YAML Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
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.
|
|
18
|
+
const quikdownVersion$1 = '1.2.19';
|
|
19
19
|
|
|
20
20
|
// Safety limit to prevent infinite loops in list parsing
|
|
21
21
|
const MAX_LOOP_ITERATIONS = 1000;
|
|
@@ -611,7 +611,7 @@ if (typeof window !== 'undefined') {
|
|
|
611
611
|
|
|
612
612
|
|
|
613
613
|
// Version will be injected at build time
|
|
614
|
-
const quikdownVersion = '1.2.
|
|
614
|
+
const quikdownVersion = '1.2.19';
|
|
615
615
|
|
|
616
616
|
/**
|
|
617
617
|
* Convert markdown to YAML
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_yaml - YAML Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
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.
|
|
16
|
+
const quikdownVersion$1 = '1.2.19';
|
|
17
17
|
|
|
18
18
|
// Safety limit to prevent infinite loops in list parsing
|
|
19
19
|
const MAX_LOOP_ITERATIONS = 1000;
|
|
@@ -609,7 +609,7 @@ if (typeof window !== 'undefined') {
|
|
|
609
609
|
|
|
610
610
|
|
|
611
611
|
// Version will be injected at build time
|
|
612
|
-
const quikdownVersion = '1.2.
|
|
612
|
+
const quikdownVersion = '1.2.19';
|
|
613
613
|
|
|
614
614
|
/**
|
|
615
615
|
* Convert markdown to YAML
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_yaml - YAML Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
4
4
|
* @license BSD-2-Clause
|
|
5
5
|
* @copyright DeftIO 2025
|
|
6
6
|
*/
|
|
7
|
-
function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const i=[],c=t.split("\n");let u=0;for(;u<c.length;){const t=c[u];if(""===t.trim()){u++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),r=[];for(u++;u<c.length;){if(c[u].match(/^(```|~~~)\s*$/)){u++;break}r.push(c[u]),u++}i.push({type:"code_block",lang:s||null,content:r.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){i.push({type:"hr"}),u++;continue}const h=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,t,e]=h;i.push({type:"heading",level:t.length,children:o(e)}),u++;continue}if(t.includes("|")){const t=r(c,u);if(t){i.push(t.node),u=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;u<c.length;)if(c[u].match(/^>\s*/))t.push(c[u].replace(/^>\s*/,"")),n=!0,u++;else{if(!n||e(c[u]))break;t.push(c[u]),u++}const r=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(r){const e=r[1].toLowerCase();i.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else i.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=l(c,u);i.push(t.node),u=t.nextIndex;continue}const f=[];for(;u<c.length;){const t=c[u];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&u+1<c.length&&/^\|?[\s\-:|]+\|?$/.test(c[u+1]))break;f.push(t),u++}f.length>0&&i.push({type:"paragraph",children:o(f.join("\n"))})}return i}function r(t,e,n){if(e+1>=t.length)return null;const s=t[e],r=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(r)||!r.includes("-"))return null;const l=i(s);if(0===l.length)return null;const c=i(r).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),u=c.length,h=[];for(let t=0;t<u;t++){const e=t<l.length?l[t]:"";h.push(o(e.trim()))}const f=[];let a=e+2;for(;a<t.length;){const e=t[a];if(!e.includes("|")||""===e.trim())break;const n=i(e),s=[];for(let t=0;t<u;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}f.push(s),a++}return{node:{type:"table",headers:h,rows:f,alignments:c},nextIndex:a}}function i(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function l(t,e,n){const s=[];let r=e,i=0;const c=t[r].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(c[2]),h=c[1].length;for(;r<t.length&&i<1e3;){i++;const e=t[r].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,c,f]=e,a=n.length;if(a<h)break;const p=/^\d+\./.test(c);if(a===h&&p!==u)break;if(a>h){const e=[];let n=0;for(;r<t.length&&n<1e3;){n++;const s=t[r],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<h)break;if(i[1].length===h)break;e.push(s),r++}if(e.length>0&&s.length>0){const t=l(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.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=o(g[2])):d.children=o(f),s.push(d),r++}return{node:{type:"list",ordered:u,items:s},nextIndex:r}}function c(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let r=t;for(;r.length>0;){if(r.match(/^(.+?)(?: {2}|\\\n|\n)/)&&r.includes("\n")){const t=r.indexOf("\n"),e=r.slice(0,t),n=r.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...u(t)),s.push({type:"br"}),r=n;continue}}const e=r.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=c(e[2]),i={type:"image",alt:e[1],url:t.trim()};n&&(i.title=n),s.push(i),r=r.slice(e[0].length);continue}const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(i){const{url:t,title:e}=c(i[2]),n={type:"link",url:t.trim(),children:u(i[1])};e&&(n.title=e),s.push(n),r=r.slice(i[0].length);continue}const l=r.match(/^`([^`\n]+)`/);if(l){s.push({type:"code",value:l[1]}),r=r.slice(l[0].length);continue}const o=r.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:u(o[2])}),r=r.slice(o[0].length);continue}const h=r.match(/^~~(.+?)~~/);if(h){s.push({type:"del",children:u(h[1])}),r=r.slice(h[0].length);continue}const f=t[t.length-r.length-1]||"",a=!/[A-Za-z0-9_]/.test(f),p=r.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||a&&r.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(p){s.push({type:"em",children:u(p[1])}),r=r.slice(p[0].length);continue}const d=r.match(/^(https?:\/\/[^\s<>[\]]+)/);if(d){const{url:t,trailing:e}=n(d[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),r=r.slice(d[0].length);continue}const g=r.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:r});break}0===g?(s.push({type:"text",value:r[0]}),r=r.slice(1)):(s.push({type:"text",value:r.slice(0,g)}),r=r.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function u(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.
|
|
7
|
+
function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const i=[],c=t.split("\n");let u=0;for(;u<c.length;){const t=c[u];if(""===t.trim()){u++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),r=[];for(u++;u<c.length;){if(c[u].match(/^(```|~~~)\s*$/)){u++;break}r.push(c[u]),u++}i.push({type:"code_block",lang:s||null,content:r.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){i.push({type:"hr"}),u++;continue}const h=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,t,e]=h;i.push({type:"heading",level:t.length,children:o(e)}),u++;continue}if(t.includes("|")){const t=r(c,u);if(t){i.push(t.node),u=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;u<c.length;)if(c[u].match(/^>\s*/))t.push(c[u].replace(/^>\s*/,"")),n=!0,u++;else{if(!n||e(c[u]))break;t.push(c[u]),u++}const r=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(r){const e=r[1].toLowerCase();i.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else i.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=l(c,u);i.push(t.node),u=t.nextIndex;continue}const f=[];for(;u<c.length;){const t=c[u];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&u+1<c.length&&/^\|?[\s\-:|]+\|?$/.test(c[u+1]))break;f.push(t),u++}f.length>0&&i.push({type:"paragraph",children:o(f.join("\n"))})}return i}function r(t,e,n){if(e+1>=t.length)return null;const s=t[e],r=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(r)||!r.includes("-"))return null;const l=i(s);if(0===l.length)return null;const c=i(r).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),u=c.length,h=[];for(let t=0;t<u;t++){const e=t<l.length?l[t]:"";h.push(o(e.trim()))}const f=[];let a=e+2;for(;a<t.length;){const e=t[a];if(!e.includes("|")||""===e.trim())break;const n=i(e),s=[];for(let t=0;t<u;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}f.push(s),a++}return{node:{type:"table",headers:h,rows:f,alignments:c},nextIndex:a}}function i(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function l(t,e,n){const s=[];let r=e,i=0;const c=t[r].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(c[2]),h=c[1].length;for(;r<t.length&&i<1e3;){i++;const e=t[r].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,c,f]=e,a=n.length;if(a<h)break;const p=/^\d+\./.test(c);if(a===h&&p!==u)break;if(a>h){const e=[];let n=0;for(;r<t.length&&n<1e3;){n++;const s=t[r],i=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!i)break;if(i[1].length<h)break;if(i[1].length===h)break;e.push(s),r++}if(e.length>0&&s.length>0){const t=l(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.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=o(g[2])):d.children=o(f),s.push(d),r++}return{node:{type:"list",ordered:u,items:s},nextIndex:r}}function c(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let r=t;for(;r.length>0;){if(r.match(/^(.+?)(?: {2}|\\\n|\n)/)&&r.includes("\n")){const t=r.indexOf("\n"),e=r.slice(0,t),n=r.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...u(t)),s.push({type:"br"}),r=n;continue}}const e=r.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=c(e[2]),i={type:"image",alt:e[1],url:t.trim()};n&&(i.title=n),s.push(i),r=r.slice(e[0].length);continue}const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(i){const{url:t,title:e}=c(i[2]),n={type:"link",url:t.trim(),children:u(i[1])};e&&(n.title=e),s.push(n),r=r.slice(i[0].length);continue}const l=r.match(/^`([^`\n]+)`/);if(l){s.push({type:"code",value:l[1]}),r=r.slice(l[0].length);continue}const o=r.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:u(o[2])}),r=r.slice(o[0].length);continue}const h=r.match(/^~~(.+?)~~/);if(h){s.push({type:"del",children:u(h[1])}),r=r.slice(h[0].length);continue}const f=t[t.length-r.length-1]||"",a=!/[A-Za-z0-9_]/.test(f),p=r.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||a&&r.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(p){s.push({type:"em",children:u(p[1])}),r=r.slice(p[0].length);continue}const d=r.match(/^(https?:\/\/[^\s<>[\]]+)/);if(d){const{url:t,trailing:e}=n(d[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),r=r.slice(d[0].length);continue}const g=r.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:r});break}0===g?(s.push({type:"text",value:r[0]}),r=r.slice(1)):(s.push({type:"text",value:r.slice(0,g)}),r=r.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function u(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof window&&(window.quikdown_ast=t);function h(e,n={}){return f(t(e,n),0)}function f(t,e){const n=" ".repeat(e);if(null==t)return"null";if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t)return String(t);if("string"==typeof t)return p(t);if(Array.isArray(t)){if(0===t.length)return"[]";const s=[];for(const r of t)if("object"!=typeof r||null===r||Array.isArray(r)){const t=f(r,e+1);s.push(`${n}- ${t}`)}else{const t=Object.entries(r);if(t.length>0){const[r,i]=t[0],l=a(i,e+1);s.push(`${n}- ${r}: ${l}`);for(let r=1;r<t.length;r++){const[i,l]=t[r],c=a(l,e+1);s.push(`${n} ${i}: ${c}`)}}else s.push(`${n}- {}`)}return"\n"+s.join("\n")}if("object"==typeof t){const s=Object.entries(t);if(0===s.length)return"{}";const r=[];for(const[t,i]of s){const s=a(i,e);r.push(`${n}${t}: ${s}`)}return r.join("\n")}return String(t)}function a(t,e){if(null==t)return"null";if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t)return String(t);if("string"==typeof t)return p(t);if(Array.isArray(t))return 0===t.length?"[]":f(t,e+1);if("object"==typeof t){return 0===Object.entries(t).length?"{}":"\n"+f(t,e+1)}return String(t)}function p(t){if(!(""===t||t.includes("\n")||t.includes(":")||t.includes("#")||t.includes("'")||t.includes('"')||t.startsWith(" ")||t.endsWith(" ")||t.startsWith("-")||t.startsWith("[")||t.startsWith("{")||"true"===t||"false"===t||"null"===t||"yes"===t||"no"===t||"on"===t||"off"===t||/^\d+$/.test(t)||/^\d+\.\d+$/.test(t)))return t;if(t.includes("\n")){return`"${t.replace(/\n/g,"\\n").replace(/"/g,'\\"')}"`}return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}h.parse=t,h.stringify=function(t){return f(t,0)},h.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=h),"undefined"!=typeof window&&(window.quikdown_yaml=h);export{h 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.
|
|
3
|
+
* @version 1.2.19
|
|
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.
|
|
22
|
+
const quikdownVersion$1 = '1.2.19';
|
|
23
23
|
|
|
24
24
|
// Safety limit to prevent infinite loops in list parsing
|
|
25
25
|
const MAX_LOOP_ITERATIONS = 1000;
|
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
|
|
616
616
|
|
|
617
617
|
// Version will be injected at build time
|
|
618
|
-
const quikdownVersion = '1.2.
|
|
618
|
+
const quikdownVersion = '1.2.19';
|
|
619
619
|
|
|
620
620
|
/**
|
|
621
621
|
* Convert markdown to YAML
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_yaml - YAML Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.19
|
|
4
4
|
* @license BSD-2-Clause
|
|
5
5
|
* @copyright DeftIO 2025
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).quikdown_yaml=e()}(this,function(){"use strict";function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const r=[],c=t.split("\n");let u=0;for(;u<c.length;){const t=c[u];if(""===t.trim()){u++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),i=[];for(u++;u<c.length;){if(c[u].match(/^(```|~~~)\s*$/)){u++;break}i.push(c[u]),u++}r.push({type:"code_block",lang:s||null,content:i.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){r.push({type:"hr"}),u++;continue}const h=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,t,e]=h;r.push({type:"heading",level:t.length,children:o(e)}),u++;continue}if(t.includes("|")){const t=i(c,u);if(t){r.push(t.node),u=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;u<c.length;)if(c[u].match(/^>\s*/))t.push(c[u].replace(/^>\s*/,"")),n=!0,u++;else{if(!n||e(c[u]))break;t.push(c[u]),u++}const i=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(i){const e=i[1].toLowerCase();r.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else r.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=l(c,u);r.push(t.node),u=t.nextIndex;continue}const f=[];for(;u<c.length;){const t=c[u];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&u+1<c.length&&/^\|?[\s\-:|]+\|?$/.test(c[u+1]))break;f.push(t),u++}f.length>0&&r.push({type:"paragraph",children:o(f.join("\n"))})}return r}function i(t,e,n){if(e+1>=t.length)return null;const s=t[e],i=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(i)||!i.includes("-"))return null;const l=r(s);if(0===l.length)return null;const c=r(i).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),u=c.length,h=[];for(let t=0;t<u;t++){const e=t<l.length?l[t]:"";h.push(o(e.trim()))}const f=[];let a=e+2;for(;a<t.length;){const e=t[a];if(!e.includes("|")||""===e.trim())break;const n=r(e),s=[];for(let t=0;t<u;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}f.push(s),a++}return{node:{type:"table",headers:h,rows:f,alignments:c},nextIndex:a}}function r(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function l(t,e,n){const s=[];let i=e,r=0;const c=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(c[2]),h=c[1].length;for(;i<t.length&&r<1e3;){r++;const e=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,c,f]=e,a=n.length;if(a<h)break;const p=/^\d+\./.test(c);if(a===h&&p!==u)break;if(a>h){const e=[];let n=0;for(;i<t.length&&n<1e3;){n++;const s=t[i],r=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!r)break;if(r[1].length<h)break;if(r[1].length===h)break;e.push(s),i++}if(e.length>0&&s.length>0){const t=l(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.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=o(g[2])):d.children=o(f),s.push(d),i++}return{node:{type:"list",ordered:u,items:s},nextIndex:i}}function c(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let i=t;for(;i.length>0;){if(i.match(/^(.+?)(?: {2}|\\\n|\n)/)&&i.includes("\n")){const t=i.indexOf("\n"),e=i.slice(0,t),n=i.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...u(t)),s.push({type:"br"}),i=n;continue}}const e=i.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=c(e[2]),r={type:"image",alt:e[1],url:t.trim()};n&&(r.title=n),s.push(r),i=i.slice(e[0].length);continue}const r=i.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(r){const{url:t,title:e}=c(r[2]),n={type:"link",url:t.trim(),children:u(r[1])};e&&(n.title=e),s.push(n),i=i.slice(r[0].length);continue}const l=i.match(/^`([^`\n]+)`/);if(l){s.push({type:"code",value:l[1]}),i=i.slice(l[0].length);continue}const o=i.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:u(o[2])}),i=i.slice(o[0].length);continue}const h=i.match(/^~~(.+?)~~/);if(h){s.push({type:"del",children:u(h[1])}),i=i.slice(h[0].length);continue}const f=t[t.length-i.length-1]||"",a=!/[A-Za-z0-9_]/.test(f),p=i.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||a&&i.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(p){s.push({type:"em",children:u(p[1])}),i=i.slice(p[0].length);continue}const d=i.match(/^(https?:\/\/[^\s<>[\]]+)/);if(d){const{url:t,trailing:e}=n(d[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),i=i.slice(d[0].length);continue}const g=i.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:i});break}0===g?(s.push({type:"text",value:i[0]}),i=i.slice(1)):(s.push({type:"text",value:i.slice(0,g)}),i=i.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function u(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).quikdown_yaml=e()}(this,function(){"use strict";function t(t,e={}){if(!t||"string"!=typeof t)return{type:"document",children:[]};return{type:"document",children:s(t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}}function e(t){const e=t.trim();return""===e||(!!/^#{1,6}\s/.test(e)||(!!(/^---+\s*$/.test(e)||/^\*\*\*+\s*$/.test(e)||/^___+\s*$/.test(e))||(!!/^>\s*/.test(e)||(!!/^[-*+]\s/.test(e)||(!!/^\d+\.\s/.test(e)||(!!e.startsWith("|")||!!/^(```|~~~)/.test(e)))))))}function n(t){let e="";const n=/[.,;:!?)]/;for(;t.length>0&&n.test(t[t.length-1]);){const n=t[t.length-1];if(")"===n){if((t.match(/\(/g)||[]).length>=(t.match(/\)/g)||[]).length)break}e=n+e,t=t.slice(0,-1)}return{url:t,trailing:e}}function s(t,n){const r=[],c=t.split("\n");let u=0;for(;u<c.length;){const t=c[u];if(""===t.trim()){u++;continue}const n=t.match(/^(```|~~~)(.*)$/);if(n){const[,t,e]=n,s=e.trim(),i=[];for(u++;u<c.length;){if(c[u].match(/^(```|~~~)\s*$/)){u++;break}i.push(c[u]),u++}r.push({type:"code_block",lang:s||null,content:i.join("\n"),fence:t});continue}if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t)){r.push({type:"hr"}),u++;continue}const h=t.match(/^(#{1,6})\s*(.+?)\s*#*$/);if(h){const[,t,e]=h;r.push({type:"heading",level:t.length,children:o(e)}),u++;continue}if(t.includes("|")){const t=i(c,u);if(t){r.push(t.node),u=t.nextIndex;continue}}if(t.match(/^>\s*/)){const t=[];let n=!0;for(;u<c.length;)if(c[u].match(/^>\s*/))t.push(c[u].replace(/^>\s*/,"")),n=!0,u++;else{if(!n||e(c[u]))break;t.push(c[u]),u++}const i=t.length>0?t[0].trim().match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i):null;if(i){const e=i[1].toLowerCase();r.push({type:"alert",alertType:e,children:s(t.slice(1).join("\n"))})}else r.push({type:"blockquote",children:s(t.join("\n"))});continue}if(t.match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/)){const t=l(c,u);r.push(t.node),u=t.nextIndex;continue}const f=[];for(;u<c.length;){const t=c[u];if(""===t.trim())break;if(/^(```|~~~)/.test(t))break;if(/^#{1,6}\s/.test(t))break;if(/^---+\s*$/.test(t)||/^\*\*\*+\s*$/.test(t)||/^___+\s*$/.test(t))break;if(/^>\s*/.test(t))break;if(/^(\s*)([*\-+]|\d+\.)\s+/.test(t))break;if(t.includes("|")&&u+1<c.length&&/^\|?[\s\-:|]+\|?$/.test(c[u+1]))break;f.push(t),u++}f.length>0&&r.push({type:"paragraph",children:o(f.join("\n"))})}return r}function i(t,e,n){if(e+1>=t.length)return null;const s=t[e],i=t[e+1];if(!/^\|?[\s\-:|]+\|?$/.test(i)||!i.includes("-"))return null;const l=r(s);if(0===l.length)return null;const c=r(i).map(t=>{const e=t.trim();return e.startsWith(":")&&e.endsWith(":")?"center":e.endsWith(":")?"right":"left"}),u=c.length,h=[];for(let t=0;t<u;t++){const e=t<l.length?l[t]:"";h.push(o(e.trim()))}const f=[];let a=e+2;for(;a<t.length;){const e=t[a];if(!e.includes("|")||""===e.trim())break;const n=r(e),s=[];for(let t=0;t<u;t++){const e=t<n.length?n[t]:"";s.push(o(e.trim()))}f.push(s),a++}return{node:{type:"table",headers:h,rows:f,alignments:c},nextIndex:a}}function r(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|")}function l(t,e,n){const s=[];let i=e,r=0;const c=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/),u=/^\d+\./.test(c[2]),h=c[1].length;for(;i<t.length&&r<1e3;){r++;const e=t[i].match(/^(\s*)([*\-+]|\d+\.)\s+(.*)$/);if(!e)break;const[,n,c,f]=e,a=n.length;if(a<h)break;const p=/^\d+\./.test(c);if(a===h&&p!==u)break;if(a>h){const e=[];let n=0;for(;i<t.length&&n<1e3;){n++;const s=t[i],r=s.match(/^(\s*)([*\-+]|\d+\.)\s+/);if(!r)break;if(r[1].length<h)break;if(r[1].length===h)break;e.push(s),i++}if(e.length>0&&s.length>0){const t=l(e,0),n=s[s.length-1];n.children?Array.isArray(n.children)||(n.children=[{type:"paragraph",children:n.children}]):n.children=[],n.children.push(t.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=o(g[2])):d.children=o(f),s.push(d),i++}return{node:{type:"list",ordered:u,items:s},nextIndex:i}}function c(t){if(null==t||""===t)return{url:"",title:null};const e=t.match(/^(.*)\s+"([^"]*)"\s*$/);if(e)return{url:e[1].replace(/\s+$/,""),title:e[2]};const n=t.match(/^(.*)\s+'([^']*)'\s*$/);return n?{url:n[1].replace(/\s+$/,""),title:n[2]}:t.startsWith("<")&&t.endsWith(">")?{url:t.slice(1,-1),title:null}:{url:t,title:null}}function o(t,e){if(!t)return[];const s=[];let i=t;for(;i.length>0;){if(i.match(/^(.+?)(?: {2}|\\\n|\n)/)&&i.includes("\n")){const t=i.indexOf("\n"),e=i.slice(0,t),n=i.slice(t+1);if(e.endsWith(" ")||e.endsWith("\\")){const t=e.replace(/\\$/,"").replace(/ +$/,"");t&&s.push(...u(t)),s.push({type:"br"}),i=n;continue}}const e=i.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){const{url:t,title:n}=c(e[2]),r={type:"image",alt:e[1],url:t.trim()};n&&(r.title=n),s.push(r),i=i.slice(e[0].length);continue}const r=i.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(r){const{url:t,title:e}=c(r[2]),n={type:"link",url:t.trim(),children:u(r[1])};e&&(n.title=e),s.push(n),i=i.slice(r[0].length);continue}const l=i.match(/^`([^`\n]+)`/);if(l){s.push({type:"code",value:l[1]}),i=i.slice(l[0].length);continue}const o=i.match(/^(\*\*|__)(.+?)\1/);if(o){s.push({type:"strong",children:u(o[2])}),i=i.slice(o[0].length);continue}const h=i.match(/^~~(.+?)~~/);if(h){s.push({type:"del",children:u(h[1])}),i=i.slice(h[0].length);continue}const f=t[t.length-i.length-1]||"",a=!/[A-Za-z0-9_]/.test(f),p=i.match(/^\*(?!\*)(.+?)(?<!\*)\*(?!\*)/)||a&&i.match(/^_(?![_\s])(.+?)(?<![\s_])_(?![A-Za-z0-9_])/);if(p){s.push({type:"em",children:u(p[1])}),i=i.slice(p[0].length);continue}const d=i.match(/^(https?:\/\/[^\s<>[\]]+)/);if(d){const{url:t,trailing:e}=n(d[1]);s.push({type:"link",url:t,children:[{type:"text",value:t}]}),e&&s.push({type:"text",value:e}),i=i.slice(d[0].length);continue}const g=i.search(/[`*_~![\\n]|https?:\/\//);if(-1===g){s.push({type:"text",value:i});break}0===g?(s.push({type:"text",value:i[0]}),i=i.slice(1)):(s.push({type:"text",value:i.slice(0,g)}),i=i.slice(g))}return function(t){const e=[];for(const n of t)"text"===n.type&&e.length>0&&"text"===e[e.length-1].type?e[e.length-1].value+=n.value:e.push(n);return e}(s)}function u(t,e){return o(t.replace(/\n/g," "))}t.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof window&&(window.quikdown_ast=t);function h(e,n={}){return f(t(e,n),0)}function f(t,e){const n=" ".repeat(e);if(null==t)return"null";if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t)return String(t);if("string"==typeof t)return p(t);if(Array.isArray(t)){if(0===t.length)return"[]";const s=[];for(const i of t)if("object"!=typeof i||null===i||Array.isArray(i)){const t=f(i,e+1);s.push(`${n}- ${t}`)}else{const t=Object.entries(i);if(t.length>0){const[i,r]=t[0],l=a(r,e+1);s.push(`${n}- ${i}: ${l}`);for(let i=1;i<t.length;i++){const[r,l]=t[i],c=a(l,e+1);s.push(`${n} ${r}: ${c}`)}}else s.push(`${n}- {}`)}return"\n"+s.join("\n")}if("object"==typeof t){const s=Object.entries(t);if(0===s.length)return"{}";const i=[];for(const[t,r]of s){const s=a(r,e);i.push(`${n}${t}: ${s}`)}return i.join("\n")}return String(t)}function a(t,e){if(null==t)return"null";if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t)return String(t);if("string"==typeof t)return p(t);if(Array.isArray(t))return 0===t.length?"[]":f(t,e+1);if("object"==typeof t){return 0===Object.entries(t).length?"{}":"\n"+f(t,e+1)}return String(t)}function p(t){if(!(""===t||t.includes("\n")||t.includes(":")||t.includes("#")||t.includes("'")||t.includes('"')||t.startsWith(" ")||t.endsWith(" ")||t.startsWith("-")||t.startsWith("[")||t.startsWith("{")||"true"===t||"false"===t||"null"===t||"yes"===t||"no"===t||"on"===t||"off"===t||/^\d+$/.test(t)||/^\d+\.\d+$/.test(t)))return t;if(t.includes("\n")){return`"${t.replace(/\n/g,"\\n").replace(/"/g,'\\"')}"`}return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}return h.parse=t,h.stringify=function(t){return f(t,0)},h.version="1.2.19","undefined"!=typeof module&&module.exports&&(module.exports=h),"undefined"!=typeof window&&(window.quikdown_yaml=h),h});
|
|
8
8
|
//# sourceMappingURL=quikdown_yaml.umd.min.js.map
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quikdown",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.19",
|
|
4
|
+
"description": "Small, safe, bidirectional Markdown parser and editor with streaming, undo/redo, rich fences, MCP tools, and a standalone airgapped build. Zero runtime deps. Browser and Node.js.",
|
|
5
5
|
"author": "deftio (https://github.com/deftio)",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
7
7
|
"repository": {
|
|
@@ -11,29 +11,40 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/deftio/quikdown/issues"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://github.
|
|
14
|
+
"homepage": "https://deftio.github.io/quikdown/pages/",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"markdown",
|
|
17
17
|
"markdown-parser",
|
|
18
|
+
"markdown-editor",
|
|
18
19
|
"markdown-to-html",
|
|
19
20
|
"markdown-bidirectional",
|
|
20
21
|
"markdown-mermaid",
|
|
21
22
|
"markdown-code",
|
|
22
23
|
"md",
|
|
23
24
|
"parser",
|
|
25
|
+
"editor",
|
|
26
|
+
"bidirectional",
|
|
24
27
|
"html",
|
|
25
28
|
"commonmark",
|
|
26
29
|
"gfm",
|
|
27
30
|
"task-lists",
|
|
28
31
|
"xss-protection",
|
|
32
|
+
"xss-safe",
|
|
29
33
|
"lightweight",
|
|
30
34
|
"zero-dependencies",
|
|
31
35
|
"browser",
|
|
32
36
|
"nodejs",
|
|
37
|
+
"node",
|
|
33
38
|
"plugin",
|
|
34
39
|
"fence",
|
|
35
40
|
"autolink",
|
|
36
41
|
"sanitization",
|
|
42
|
+
"streaming",
|
|
43
|
+
"llm",
|
|
44
|
+
"offline",
|
|
45
|
+
"standalone",
|
|
46
|
+
"airgapped",
|
|
47
|
+
"undo-redo",
|
|
37
48
|
"mcp",
|
|
38
49
|
"model-context-protocol"
|
|
39
50
|
],
|