@mdit/plugin-container
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -50,3 +50,3 @@ import { RenderRule } from 'markdown-it/lib/renderer.mjs'; | ||
/** | ||
* Forked and modified from https://github.com/markdown-it/markdown-it-container/blob/master/index.js | ||
* Forked and modified from https://github.com/markdown-it/markdown-it-container/blob/master/index.mjs | ||
*/ | ||
@@ -53,0 +53,0 @@ |
@@ -1,2 +0,2 @@ | ||
const S=(b,{name:c,marker:p=":",validate:m=a=>a.trim().split(" ",2)[0]===c,openRender:h=(a,o,l,e,s)=>(a[o].attrJoin("class",c),s.renderToken(a,o,l)),closeRender:T=(a,o,l,e,s)=>s.renderToken(a,o,l)}={name:""})=>{const a=p[0],o=p.length,l=(e,s,$,x)=>{let t=e.bMarks[s]+e.tShift[s],i=e.eMarks[s];if(a!==e.src[t])return!1;let n=t+1;for(;n<=i&&p[(n-t)%o]===e.src[n];)n+=1;const k=Math.floor((n-t)/o);if(k<3)return!1;n-=(n-t)%o;const d=e.src.slice(t,n),u=e.src.slice(n,i);if(!m(u,d))return!1;if(x)return!0;let r=s,M=!1;for(;r<$&&(r+=1,t=e.bMarks[r]+e.tShift[r],i=e.eMarks[r],!(t<i&&e.sCount[r]<e.blkIndent));)if(a===e.src[t]&&e.sCount[r]-e.blkIndent<4){for(n=t+1;n<=i&&p[(n-t)%o]===e.src[n];n++);if(Math.floor((n-t)/o)>=k&&(n-=(n-t)%o,n=e.skipSpaces(n),n>=i)){M=!0;break}}const y=e.parentType,v=e.lineMax;e.parentType="container",e.lineMax=r;const f=e.push(`container_${c}_open`,"div",1);f.markup=d,f.block=!0,f.info=u,f.map=[s,r],e.md.block.tokenize(e,s+1,r);const _=e.push(`container_${c}_close`,"div",-1);return _.markup=e.src.slice(t,n),_.block=!0,e.parentType=y,e.lineMax=v,e.line=r+(M?1:0),!0};b.block.ruler.before("fence",`container_${c}`,l,{alt:["paragraph","reference","blockquote","list"]}),b.renderer.rules[`container_${c}_open`]=h,b.renderer.rules[`container_${c}_close`]=T};export{S as container}; | ||
const S=(b,{name:c,marker:p=":",validate:m=a=>a.trim().split(" ",2)[0]===c,openRender:h=(a,o,l,e,s)=>(a[o].attrJoin("class",c),s.renderToken(a,o,l)),closeRender:T=(a,o,l,e,s)=>s.renderToken(a,o,l)}={name:""})=>{const a=p[0],o=p.length,l=(e,s,$,x)=>{let t=e.bMarks[s]+e.tShift[s],i=e.eMarks[s];if(a!==e.src[t])return!1;let n=t+1;for(;n<=i&&p[(n-t)%o]===e.src[n];)n++;const k=Math.floor((n-t)/o);if(k<3)return!1;n-=(n-t)%o;const d=e.src.slice(t,n),u=e.src.slice(n,i);if(!m(u,d))return!1;if(x)return!0;let r=s,M=!1;for(;r<$&&(r++,t=e.bMarks[r]+e.tShift[r],i=e.eMarks[r],!(t<i&&e.sCount[r]<e.blkIndent));)if(a===e.src[t]&&e.sCount[r]-e.blkIndent<4){for(n=t+1;n<=i&&p[(n-t)%o]===e.src[n];n++);if(Math.floor((n-t)/o)>=k&&(n-=(n-t)%o,n=e.skipSpaces(n),n>=i)){M=!0;break}}const y=e.parentType,v=e.lineMax;e.parentType="container",e.lineMax=r;const f=e.push(`container_${c}_open`,"div",1);f.markup=d,f.block=!0,f.info=u,f.map=[s,r],e.md.block.tokenize(e,s+1,r);const _=e.push(`container_${c}_close`,"div",-1);return _.markup=e.src.slice(t,n),_.block=!0,e.parentType=y,e.lineMax=v,e.line=r+(M?1:0),!0};b.block.ruler.before("fence",`container_${c}`,l,{alt:["paragraph","reference","blockquote","list"]}),b.renderer.rules[`container_${c}_open`]=h,b.renderer.rules[`container_${c}_close`]=T};export{S as container}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@mdit/plugin-container", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "container plugin for MarkdownIt", | ||
"keywords": [ | ||
"markdownit", | ||
"markdown-it", | ||
@@ -8,0 +7,0 @@ "markdown-it-plugin", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13158