Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-it-multimd-table

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-multimd-table - npm Package Compare versions

Comparing version 4.2.1 to 4.2.2

10

dist/markdown-it-multimd-table.js

@@ -1,2 +0,2 @@

/*! markdown-it-multimd-table 4.2.1 https://github.com/redbug312/markdown-it-multimd-table @license MIT */
/*! markdown-it-multimd-table 4.2.2 https://github.com/redbug312/markdown-it-multimd-table @license MIT */
(function(global, factory) {

@@ -364,5 +364,11 @@ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,

token.map = tableToken.meta.cap.map;
var attrs = [];
var capSide = tableToken.meta.cap.first ? "top" : "bottom";
/* Null is possible when disabled the option autolabel */ if (tableToken.meta.cap.label !== null) {
token.attrs = [ [ "id", tableToken.meta.cap.label ] ];
attrs.push([ "id", tableToken.meta.cap.label ]);
}
/* Add caption-side inline-CSS to <caption> tag, if caption is below the markdown table. */ if (capSide !== "top") {
attrs.push([ "style", "caption-side: " + capSide ]);
}
token.attrs = attrs;
token = state.push("inline", "", 0);

@@ -369,0 +375,0 @@ token.content = tableToken.meta.cap.text;

4

dist/markdown-it-multimd-table.min.js

@@ -1,2 +0,2 @@

/*! markdown-it-multimd-table 4.2.1 https://github.com/redbug312/markdown-it-multimd-table @license MIT */
!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).markdownit=e()}(this,(function(){"use strict";function t(){this.__highest_alphabet__=0,this.__match_alphabets__={},this.__initial_state__=0,this.__accept_states__={},this.__transitions__={},this.__actions__={}}t.prototype.set_highest_alphabet=function(t){this.__highest_alphabet__=t},t.prototype.set_match_alphabets=function(t){this.__match_alphabets__=t},t.prototype.set_initial_state=function(t){this.__initial_state__=t},t.prototype.set_accept_states=function(t){for(var e=0;e<t.length;e++)this.__accept_states__[t[e]]=!0},t.prototype.set_transitions=function(t){this.__transitions__=t},t.prototype.set_actions=function(t){this.__actions__=t},t.prototype.update_transition=function(t,e){this.__transitions__[t]=Object.assign(this.__transitions__[t]||Object(),e)},t.prototype.execute=function(t,e){var a,s,n;for(a=this.__initial_state__,s=t;a&&s<e;s++){for(n=this.__highest_alphabet__;n>0&&!(a&n&&this.__match_alphabets__[n].call(this,s,a,n));n>>=4);if(this.__actions__(s,a,n),0===n)break;a=this.__transitions__[a][n]||0}return!!this.__accept_states__[a]};var e=t;return function(t,a){function s(t,e){var a,s,n=t.bMarks[e]+t.sCount[e],i=t.bMarks[e]+t.blkIndent,l=t.skipSpacesBack(t.eMarks[e],i),r=[],p=!1,o=!1,_=0;for(a=n;a<l;a++)switch(t.src.charCodeAt(a)){case 92:p=!0;break;case 96:(s=t.skipChars(a,96)-1)>a?(o||(0===_?_=s-a:_===s-a&&(_=0)),a=s):(o||!p&&!_)&&(o=!o),p=!1;break;case 124:o||p||r.push(a),p=!1;break;default:p=!1}return 0===r.length||(r[0]>i&&r.unshift(i-1),r[r.length-1]<l-1&&r.push(l)),r}function n(t,e,s){var n={text:null,label:null},i=t.bMarks[s]+t.sCount[s],l=t.eMarks[s],r=t.src.slice(i,l).match(/^\[(.+?)\](\[([^\[\]]+)\])?\s*$/);return!!r&&(!!e||(n.text=r[1],a.autolabel||r[2]?(n.label=r[2]||r[1],n.label=n.label.toLowerCase().replace(/\W+/g,""),n):n))}function i(t,e,n){var i,l,r,p={bounds:null,multiline:null},o=s(t,n);return!(o.length<2)&&(!!e||(p.bounds=o,a.multiline&&(i=t.bMarks[n]+t.sCount[n],l=t.eMarks[n]-1,p.multiline=92===t.src.charCodeAt(l),p.multiline&&(r=t.eMarks[n],t.eMarks[n]=t.skipSpacesBack(l,i),p.bounds=s(t,n),t.eMarks[n]=r)),p))}function l(t,e,a){var n,i,l={aligns:[],wraps:[]},r=s(t,a),p=/^:?(-+|=+):?\+?$/;if(t.sCount[a]-t.blkIndent>=4)return!1;if(0===r.length)return!1;for(n=0;n<r.length-1;n++){if(i=t.src.slice(r[n]+1,r[n+1]).trim(),!p.test(i))return!1;switch(l.wraps.push(43===i.charCodeAt(i.length-1)),(58===i.charCodeAt(0))<<4|58===i.charCodeAt(i.length-1-l.wraps[n])){case 0:l.aligns.push("");break;case 1:l.aligns.push("right");break;case 16:l.aligns.push("left");break;case 17:l.aligns.push("center")}}return!!e||l}function r(t,e,a){return t.isEmpty(a)}a=t.utils.assign({},{multiline:!1,rowspan:!1,headerless:!1,multibody:!0,autolabel:!0},a||{}),t.block.ruler.at("table",(function(t,s,p,o){var _,c,h,m,u,b,d,f,k,g,y,w,v,M,x,C,T=new e,A=16,j=-1,S=[];if(s+2>p)return!1;if((c=new t.Token("table_open","table",1)).meta={sep:null,cap:null,tr:[]},T.set_highest_alphabet(65536),T.set_initial_state(65792),T.set_accept_states([65552,65553,0]),T.set_match_alphabets({65536:n.bind(this,t,!0),4096:l.bind(this,t,!0),256:i.bind(this,t,!0),16:i.bind(this,t,!0),1:r.bind(this,t,!0)}),T.set_transitions({65792:{65536:256,256:4352},256:{256:4352},4352:{4096:65552,256:4352},65552:{65536:0,16:65553},65553:{65536:0,16:65553,1:65552}}),a.headerless&&(T.set_initial_state(69888),T.update_transition(69888,{65536:4352,4096:65552,256:4352}),(h=new t.Token("tr_placeholder","tr",0)).meta=Object()),a.multibody||T.update_transition(65552,{65536:0,16:65552}),T.set_actions((function(e,r,p){switch(p){case 65536:if(c.meta.cap)break;c.meta.cap=n(t,!1,e),c.meta.cap.map=[e,e+1],c.meta.cap.first=e===s;break;case 4096:c.meta.sep=l(t,!1,e),c.meta.sep.map=[e,e+1],h.meta.grp|=1,A=16;break;case 256:case 16:(h=new t.Token("tr_open","tr",1)).map=[e,e+1],h.meta=i(t,!1,e),h.meta.type=p,h.meta.grp=A,A=0,c.meta.tr.push(h),a.multiline&&(h.meta.multiline&&j<0?j=c.meta.tr.length-1:!h.meta.multiline&&j>=0&&((_=c.meta.tr[j]).meta.mbounds=c.meta.tr.slice(j).map((function(t){return t.meta.bounds})),_.map[1]=h.map[1],c.meta.tr=c.meta.tr.slice(0,j+1),j=-1));break;case 1:h.meta.grp|=1,A=16}})),!1===T.execute(s,p))return!1;if(!c.meta.tr.length)return!1;if(o)return!0;for(c.meta.tr[c.meta.tr.length-1].meta.grp|=1,c.map=d=[s,0],c.block=!0,c.level=t.level++,t.tokens.push(c),c.meta.cap&&((_=t.push("caption_open","caption",1)).map=c.meta.cap.map,null!==c.meta.cap.label&&(_.attrs=[["id",c.meta.cap.label]]),(_=t.push("inline","",0)).content=c.meta.cap.text,_.map=c.meta.cap.map,_.children=[],_=t.push("caption_close","caption",-1)),w=0;w<c.meta.tr.length;w++){for(u=new t.Token("td_th_placeholder","",0),16&(h=c.meta.tr[w]).meta.grp&&(k=256===h.meta.type?"thead":"tbody",(_=t.push(k+"_open",k,1)).map=f=[h.map[0],0],S=[]),h.block=!0,h.level=t.level++,t.tokens.push(h),v=0;v<h.meta.bounds.length-1;v++)if(y=[h.meta.bounds[v]+1,h.meta.bounds[v+1]],""!==(g=t.src.slice.apply(t.src,y)))if(a.rowspan&&S[v]&&"^^"===g.trim())b=S[v].attrGet("rowspan"),S[v].attrSet("rowspan",null===b?2:b+1),u=new t.Token("td_th_placeholder","",0);else{if(k=256===h.meta.type?"th":"td",(_=t.push(k+"_open",k,1)).map=h.map,_.attrs=[],c.meta.sep.aligns[v]&&_.attrs.push(["style","text-align:"+c.meta.sep.aligns[v]]),c.meta.sep.wraps[v]&&_.attrs.push(["class","extend"]),u=S[v]=_,a.multiline&&h.meta.multiline&&h.meta.mbounds){for(g=new Array(h.map[0]).fill("").concat([g.trimRight()]),M=1;M<h.meta.mbounds.length;M++)v>h.meta.mbounds[M].length-2||(y=[h.meta.mbounds[M][v]+1,h.meta.mbounds[M][v+1]],g.push(t.src.slice.apply(t.src,y).trimRight()));for((C=new t.md.block.State(g.join("\n"),t.md,t.env,[])).level=h.level+1,t.md.block.tokenize(C,h.map[0],C.lineMax),x=0;x<C.tokens.length;x++)t.tokens.push(C.tokens[x])}else(_=t.push("inline","",0)).content=g.trim(),_.map=h.map,_.level=h.level+1,_.children=[];_=t.push(k+"_close",k,-1)}else m=u.attrGet("colspan"),u.attrSet("colspan",null===m?2:m+1);t.push("tr_close","tr",-1),1&h.meta.grp&&(k=256===h.meta.type?"thead":"tbody",_=t.push(k+"_close",k,-1),f[1]=h.map[1])}return d[1]=Math.max(f[1],c.meta.sep.map[1],c.meta.cap?c.meta.cap.map[1]:-1),_=t.push("table_close","table",-1),t.line=d[1],!0}),{alt:["paragraph","reference"]})}}));
/*! markdown-it-multimd-table 4.2.2 https://github.com/redbug312/markdown-it-multimd-table @license MIT */
!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).markdownit=e()}(this,(function(){"use strict";function t(){this.__highest_alphabet__=0,this.__match_alphabets__={},this.__initial_state__=0,this.__accept_states__={},this.__transitions__={},this.__actions__={}}t.prototype.set_highest_alphabet=function(t){this.__highest_alphabet__=t},t.prototype.set_match_alphabets=function(t){this.__match_alphabets__=t},t.prototype.set_initial_state=function(t){this.__initial_state__=t},t.prototype.set_accept_states=function(t){for(var e=0;e<t.length;e++)this.__accept_states__[t[e]]=!0},t.prototype.set_transitions=function(t){this.__transitions__=t},t.prototype.set_actions=function(t){this.__actions__=t},t.prototype.update_transition=function(t,e){this.__transitions__[t]=Object.assign(this.__transitions__[t]||Object(),e)},t.prototype.execute=function(t,e){var a,s,n;for(a=this.__initial_state__,s=t;a&&s<e;s++){for(n=this.__highest_alphabet__;n>0&&!(a&n&&this.__match_alphabets__[n].call(this,s,a,n));n>>=4);if(this.__actions__(s,a,n),0===n)break;a=this.__transitions__[a][n]||0}return!!this.__accept_states__[a]};var e=t;return function(t,a){function s(t,e){var a,s,n=t.bMarks[e]+t.sCount[e],i=t.bMarks[e]+t.blkIndent,l=t.skipSpacesBack(t.eMarks[e],i),r=[],p=!1,o=!1,c=0;for(a=n;a<l;a++)switch(t.src.charCodeAt(a)){case 92:p=!0;break;case 96:(s=t.skipChars(a,96)-1)>a?(o||(0===c?c=s-a:c===s-a&&(c=0)),a=s):(o||!p&&!c)&&(o=!o),p=!1;break;case 124:o||p||r.push(a),p=!1;break;default:p=!1}return 0===r.length||(r[0]>i&&r.unshift(i-1),r[r.length-1]<l-1&&r.push(l)),r}function n(t,e,s){var n={text:null,label:null},i=t.bMarks[s]+t.sCount[s],l=t.eMarks[s],r=t.src.slice(i,l).match(/^\[(.+?)\](\[([^\[\]]+)\])?\s*$/);return!!r&&(!!e||(n.text=r[1],a.autolabel||r[2]?(n.label=r[2]||r[1],n.label=n.label.toLowerCase().replace(/\W+/g,""),n):n))}function i(t,e,n){var i,l,r,p={bounds:null,multiline:null},o=s(t,n);return!(o.length<2)&&(!!e||(p.bounds=o,a.multiline&&(i=t.bMarks[n]+t.sCount[n],l=t.eMarks[n]-1,p.multiline=92===t.src.charCodeAt(l),p.multiline&&(r=t.eMarks[n],t.eMarks[n]=t.skipSpacesBack(l,i),p.bounds=s(t,n),t.eMarks[n]=r)),p))}function l(t,e,a){var n,i,l={aligns:[],wraps:[]},r=s(t,a),p=/^:?(-+|=+):?\+?$/;if(t.sCount[a]-t.blkIndent>=4)return!1;if(0===r.length)return!1;for(n=0;n<r.length-1;n++){if(i=t.src.slice(r[n]+1,r[n+1]).trim(),!p.test(i))return!1;switch(l.wraps.push(43===i.charCodeAt(i.length-1)),(58===i.charCodeAt(0))<<4|58===i.charCodeAt(i.length-1-l.wraps[n])){case 0:l.aligns.push("");break;case 1:l.aligns.push("right");break;case 16:l.aligns.push("left");break;case 17:l.aligns.push("center")}}return!!e||l}function r(t,e,a){return t.isEmpty(a)}a=t.utils.assign({},{multiline:!1,rowspan:!1,headerless:!1,multibody:!0,autolabel:!0},a||{}),t.block.ruler.at("table",(function(t,s,p,o){var c,_,h,m,u,b,d,f,k,g,y,w,v,M,x,C,T=new e,A=16,j=-1,S=[];if(s+2>p)return!1;if((_=new t.Token("table_open","table",1)).meta={sep:null,cap:null,tr:[]},T.set_highest_alphabet(65536),T.set_initial_state(65792),T.set_accept_states([65552,65553,0]),T.set_match_alphabets({65536:n.bind(this,t,!0),4096:l.bind(this,t,!0),256:i.bind(this,t,!0),16:i.bind(this,t,!0),1:r.bind(this,t,!0)}),T.set_transitions({65792:{65536:256,256:4352},256:{256:4352},4352:{4096:65552,256:4352},65552:{65536:0,16:65553},65553:{65536:0,16:65553,1:65552}}),a.headerless&&(T.set_initial_state(69888),T.update_transition(69888,{65536:4352,4096:65552,256:4352}),(h=new t.Token("tr_placeholder","tr",0)).meta=Object()),a.multibody||T.update_transition(65552,{65536:0,16:65552}),T.set_actions((function(e,r,p){switch(p){case 65536:if(_.meta.cap)break;_.meta.cap=n(t,!1,e),_.meta.cap.map=[e,e+1],_.meta.cap.first=e===s;break;case 4096:_.meta.sep=l(t,!1,e),_.meta.sep.map=[e,e+1],h.meta.grp|=1,A=16;break;case 256:case 16:(h=new t.Token("tr_open","tr",1)).map=[e,e+1],h.meta=i(t,!1,e),h.meta.type=p,h.meta.grp=A,A=0,_.meta.tr.push(h),a.multiline&&(h.meta.multiline&&j<0?j=_.meta.tr.length-1:!h.meta.multiline&&j>=0&&((c=_.meta.tr[j]).meta.mbounds=_.meta.tr.slice(j).map((function(t){return t.meta.bounds})),c.map[1]=h.map[1],_.meta.tr=_.meta.tr.slice(0,j+1),j=-1));break;case 1:h.meta.grp|=1,A=16}})),!1===T.execute(s,p))return!1;if(!_.meta.tr.length)return!1;if(o)return!0;if(_.meta.tr[_.meta.tr.length-1].meta.grp|=1,_.map=d=[s,0],_.block=!0,_.level=t.level++,t.tokens.push(_),_.meta.cap){(c=t.push("caption_open","caption",1)).map=_.meta.cap.map;var O=[],B=_.meta.cap.first?"top":"bottom";null!==_.meta.cap.label&&O.push(["id",_.meta.cap.label]),"top"!==B&&O.push(["style","caption-side: "+B]),c.attrs=O,(c=t.push("inline","",0)).content=_.meta.cap.text,c.map=_.meta.cap.map,c.children=[],c=t.push("caption_close","caption",-1)}for(w=0;w<_.meta.tr.length;w++){for(u=new t.Token("td_th_placeholder","",0),16&(h=_.meta.tr[w]).meta.grp&&(k=256===h.meta.type?"thead":"tbody",(c=t.push(k+"_open",k,1)).map=f=[h.map[0],0],S=[]),h.block=!0,h.level=t.level++,t.tokens.push(h),v=0;v<h.meta.bounds.length-1;v++)if(y=[h.meta.bounds[v]+1,h.meta.bounds[v+1]],""!==(g=t.src.slice.apply(t.src,y)))if(a.rowspan&&S[v]&&"^^"===g.trim())b=S[v].attrGet("rowspan"),S[v].attrSet("rowspan",null===b?2:b+1),u=new t.Token("td_th_placeholder","",0);else{if(k=256===h.meta.type?"th":"td",(c=t.push(k+"_open",k,1)).map=h.map,c.attrs=[],_.meta.sep.aligns[v]&&c.attrs.push(["style","text-align:"+_.meta.sep.aligns[v]]),_.meta.sep.wraps[v]&&c.attrs.push(["class","extend"]),u=S[v]=c,a.multiline&&h.meta.multiline&&h.meta.mbounds){for(g=new Array(h.map[0]).fill("").concat([g.trimRight()]),M=1;M<h.meta.mbounds.length;M++)v>h.meta.mbounds[M].length-2||(y=[h.meta.mbounds[M][v]+1,h.meta.mbounds[M][v+1]],g.push(t.src.slice.apply(t.src,y).trimRight()));for((C=new t.md.block.State(g.join("\n"),t.md,t.env,[])).level=h.level+1,t.md.block.tokenize(C,h.map[0],C.lineMax),x=0;x<C.tokens.length;x++)t.tokens.push(C.tokens[x])}else(c=t.push("inline","",0)).content=g.trim(),c.map=h.map,c.level=h.level+1,c.children=[];c=t.push(k+"_close",k,-1)}else m=u.attrGet("colspan"),u.attrSet("colspan",null===m?2:m+1);t.push("tr_close","tr",-1),1&h.meta.grp&&(k=256===h.meta.type?"thead":"tbody",c=t.push(k+"_close",k,-1),f[1]=h.map[1])}return d[1]=Math.max(f[1],_.meta.sep.map[1],_.meta.cap?_.meta.cap.map[1]:-1),c=t.push("table_close","table",-1),t.line=d[1],!0}),{alt:["paragraph","reference"]})}}));

@@ -270,7 +270,17 @@ 'use strict';

var attrs = [];
var capSide = tableToken.meta.cap.first ? 'top' : 'bottom';
/* Null is possible when disabled the option autolabel */
if (tableToken.meta.cap.label !== null) {
token.attrs = [ [ 'id', tableToken.meta.cap.label ] ];
attrs.push([ 'id', tableToken.meta.cap.label ]);
}
/* Add caption-side inline-CSS to <caption> tag, if caption is below the markdown table. */
if (capSide !== 'top') {
attrs.push([ 'style', 'caption-side: ' + capSide ]);
}
token.attrs = attrs;
token = state.push('inline', '', 0);

@@ -277,0 +287,0 @@ token.content = tableToken.meta.cap.text;

{
"name": "markdown-it-multimd-table",
"version": "4.2.1",
"version": "4.2.2",
"description": "Multimarkdown table syntax plugin for markdown-it markdown parser",

@@ -5,0 +5,0 @@ "keywords": [

@@ -615,3 +615,3 @@ ---

<table>
<caption>nolabel</caption>
<caption style="caption-side: bottom">nolabel</caption>
<tbody>

@@ -618,0 +618,0 @@ <tr>

@@ -488,3 +488,3 @@ ---

<table>
<caption id=""> | | </caption>
<caption id="" style="caption-side: bottom"> | | </caption>
<thead>

@@ -610,3 +610,3 @@ <tr>

<table>
<caption id="prototypetable">Prototype table</caption>
<caption id="prototypetable" style="caption-side: bottom">Prototype table</caption>
<thead>

@@ -653,3 +653,3 @@ <tr>

<table>
<caption id="prototypetable">Prototype table</caption>
<caption id="prototypetable" style="caption-side: bottom">Prototype table</caption>
<thead>

@@ -656,0 +656,0 @@ <tr>

@@ -302,3 +302,3 @@ ---

<table>
<caption id="captionallowsboldorlinkrepo">caption allows <strong>bold</strong> or <a href="https://github.com/redbug312/markdown-it-multimd-table">link</a></caption>
<caption id="captionallowsboldorlinkrepo" style="caption-side: bottom">caption allows <strong>bold</strong> or <a href="https://github.com/redbug312/markdown-it-multimd-table">link</a></caption>
<thead>

@@ -329,3 +329,3 @@ <tr>

<table>
<caption id="labeled">caption allows <strong>bold</strong> or <a href="https://github.com/redbug312/markdown-it-multimd-table">link</a></caption>
<caption id="labeled" style="caption-side: bottom">caption allows <strong>bold</strong> or <a href="https://github.com/redbug312/markdown-it-multimd-table">link</a></caption>
<thead>

@@ -332,0 +332,0 @@ <tr>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc