quikdown 1.2.11 → 1.2.12
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/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 +2 -2
- package/dist/quikdown_edit.esm.js +2 -2
- package/dist/quikdown_edit.esm.min.js +2 -2
- package/dist/quikdown_edit.esm.min.js.gz +0 -0
- package/dist/quikdown_edit.umd.js +2 -2
- package/dist/quikdown_edit.umd.min.js +2 -2
- package/dist/quikdown_edit.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_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 +1 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quikdown_yaml - YAML Markdown Parser
|
|
3
|
-
* @version 1.2.
|
|
3
|
+
* @version 1.2.12
|
|
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;){if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const e=s.indexOf("\n"),t=s.slice(0,e),i=s.slice(e+1);if(t.endsWith(" ")||t.endsWith("\\")){const e=t.replace(/\\$/,"").replace(/ +$/,"");e&&n.push(...c(e)),n.push({type:"br"}),s=i;continue}}const e=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(e){n.push({type:"image",alt:e[1],url:e[2].trim()}),s=s.slice(e[0].length);continue}const t=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"link",url:t[2].trim(),children:c(t[1])}),s=s.slice(t[0].length);continue}const i=s.match(/^`([^`]+)`/);if(i){n.push({type:"code",value:i[1]}),s=s.slice(i[0].length);continue}const r=s.match(/^(\*\*|__)(.+?)\1/);if(r){n.push({type:"strong",children:c(r[2])}),s=s.slice(r[0].length);continue}const o=s.match(/^~~(.+?)~~/);if(o){n.push({type:"del",children:c(o[1])}),s=s.slice(o[0].length);continue}const l=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(l){n.push({type:"em",children:c(l[2])}),s=s.slice(l[0].length);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);continue}const h=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===h){n.push({type:"text",value:s});break}0===h?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,h)}),s=s.slice(h))}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
|
+
!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;){if(s.match(/^(.+?)(?: {2}|\\\n|\n)/)&&s.includes("\n")){const e=s.indexOf("\n"),t=s.slice(0,e),i=s.slice(e+1);if(t.endsWith(" ")||t.endsWith("\\")){const e=t.replace(/\\$/,"").replace(/ +$/,"");e&&n.push(...c(e)),n.push({type:"br"}),s=i;continue}}const e=s.match(/^!\[([^\]]*)\]\(\s*([^)\s]+)\s*\)/);if(e){n.push({type:"image",alt:e[1],url:e[2].trim()}),s=s.slice(e[0].length);continue}const t=s.match(/^\[([^\]]+)\]\(\s*([^)\s]+)\s*\)/);if(t){n.push({type:"link",url:t[2].trim(),children:c(t[1])}),s=s.slice(t[0].length);continue}const i=s.match(/^`([^`]+)`/);if(i){n.push({type:"code",value:i[1]}),s=s.slice(i[0].length);continue}const r=s.match(/^(\*\*|__)(.+?)\1/);if(r){n.push({type:"strong",children:c(r[2])}),s=s.slice(r[0].length);continue}const o=s.match(/^~~(.+?)~~/);if(o){n.push({type:"del",children:c(o[1])}),s=s.slice(o[0].length);continue}const l=s.match(/^(\*|_)(?!\1)(.+?)(?<!\1)\1(?!\1)/);if(l){n.push({type:"em",children:c(l[2])}),s=s.slice(l[0].length);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);continue}const h=s.search(/[`*_~![\\n]|https?:\/\//);if(-1===h){n.push({type:"text",value:s});break}0===h?(n.push({type:"text",value:s[0]}),s=s.slice(1)):(n.push({type:"text",value:s.slice(0,h)}),s=s.slice(h))}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.12","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.12","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.
|
|
3
|
+
"version": "1.2.12",
|
|
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",
|
|
@@ -104,7 +104,6 @@
|
|
|
104
104
|
"test:e2e": "npx playwright test --config=playwright.config.cjs",
|
|
105
105
|
"test:e2e:full": "npx playwright test --config=playwright.config.cjs",
|
|
106
106
|
"test:editor:e2e": "npx playwright test tests/quikdown-editor.spec.js",
|
|
107
|
-
"minifyCSS": "node ./tools/minifyCSS.cjs",
|
|
108
107
|
"updateVersion": "node ./tools/updateVersion",
|
|
109
108
|
"updateBadges": "node ./tools/updateBadges.js",
|
|
110
109
|
"feature": "bash ./tools/feature.sh",
|
|
@@ -220,7 +219,6 @@
|
|
|
220
219
|
"clean-css": "^5.3.3",
|
|
221
220
|
"clean-css-cli": "^5.6.3",
|
|
222
221
|
"cssnano": "^7.1.5",
|
|
223
|
-
"docbat": "^0.9.3",
|
|
224
222
|
"dompurify": "^3.4.0",
|
|
225
223
|
"eslint": "^10.2.1",
|
|
226
224
|
"eslint-plugin-security": "^4.0.0",
|