12 |
- /*! markdown-it-deflist 2.0.3 https://github.com//markdown-it/markdown-it-deflist @license MIT */
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.markdownitDeflist=e()}}(function(){return function e(n,t,r){function i(f,d){if(!t[f]){if(!n[f]){var s="function"==typeof require&&require;if(!d&&s)return s(f,!0);if(o)return o(f,!0);var u=new Error("Cannot find module '"+f+"'");throw u.code="MODULE_NOT_FOUND",u}var a=t[f]={exports:{}};n[f][0].call(a.exports,function(e){var t=n[f][1][e];return i(t||e)},a,a.exports,e,n,t,r)}return t[f].exports}for(var o="function"==typeof require&&require,f=0;f<r.length;f++)i(r[f]);return i}({1:[function(e,n,t){"use strict";n.exports=function(e){function n(e,n){var t,r,i=e.bMarks[n]+e.tShift[n],o=e.eMarks[n];return i>=o?-1:126!==(r=e.src.charCodeAt(i++))&&58!==r?-1:(t=e.skipSpaces(i),i===t?-1:t>=o?-1:i)}function t(e,n){var t,r,i=e.level+2;for(t=n+2,r=e.tokens.length-2;t<r;t++)e.tokens[t].level===i&&"paragraph_open"===e.tokens[t].type&&(e.tokens[t+2].hidden=!0,e.tokens[t].hidden=!0,t+=2)}function r(e,r,o,f){var d,s,u,a,p,l,k,c,h,b,y,m,g,v,C,I,_,w,x,S;if(f)return!(e.ddIndent<0)&&n(e,r)>=0;if((h=r+1)>=o)return!1;if(e.isEmpty(h)&&++h>=o)return!1;if(e.sCount[h]<e.blkIndent)return!1;if((s=n(e,h))<0)return!1;k=e.tokens.length,x=!0,S=e.push("dl_open","dl",1),S.map=l=[r,0],a=r,u=h;e:for(;;){for(w=!1,S=e.push("dt_open","dt",1),S.map=[a,a],S=e.push("inline","",0),S.map=[a,a],S.content=e.getLines(a,a+1,e.blkIndent,!1).trim(),S.children=[],S=e.push("dt_close","dt",-1);;){for(S=e.push("dd_open","dd",1),S.map=p=[h,0],_=s,c=e.eMarks[u],b=e.sCount[u]+s-(e.bMarks[u]+e.tShift[u]);_<c&&(d=e.src.charCodeAt(_),i(d));)9===d?b+=4-b%4:b++,_++;if(s=_,I=e.tight,y=e.ddIndent,m=e.blkIndent,C=e.tShift[u],v=e.sCount[u],g=e.parentType,e.blkIndent=e.ddIndent=e.sCount[u]+2,e.tShift[u]=s-e.bMarks[u],e.sCount[u]=b,e.tight=!0,e.parentType="deflist",e.md.block.tokenize(e,u,o,!0),e.tight&&!w||(x=!1),w=e.line-u>1&&e.isEmpty(e.line-1),e.tShift[u]=C,e.sCount[u]=v,e.tight=I,e.parentType=g,e.blkIndent=m,e.ddIndent=y,S=e.push("dd_close","dd",-1),p[1]=h=e.line,h>=o)break e;if(e.sCount[h]<e.blkIndent)break e;if((s=n(e,h))<0)break;u=h}if(h>=o)break;if(a=h,e.isEmpty(a))break;if(e.sCount[a]<e.blkIndent)break;if((u=a+1)>=o)break;if(e.isEmpty(u)&&u++,u>=o)break;if(e.sCount[u]<e.blkIndent)break;if((s=n(e,u))<0)break}return S=e.push("dl_close","dl",-1),l[1]=h,e.line=h,x&&t(e,k),!0}var i=e.utils.isSpace;e.block.ruler.before("paragraph","deflist",r,{alt:["paragraph","reference"]})}},{}]},{},[1])(1)});
|