|
|
|
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).commonmark=f()}}(function(){return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){"use strict";var Node=require("./node"),unescapeString=require("./common").unescapeString,OPENTAG=require("./common").OPENTAG,CLOSETAG=require("./common").CLOSETAG,InlineParser=require("./inlines"),reHtmlBlockOpen=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)/i,new RegExp("^(?:"+OPENTAG+"|"+CLOSETAG+")\\s*$","i")],reHtmlBlockClose=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],reThematicBreak=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,reMaybeSpecial=/^[#`~*+_=<>0-9-]/,reNonSpace=/[^ \t\f\v\r\n]/,reBulletListMarker=/^[*+-]/,reOrderedListMarker=/^(\d{1,9})([.)])/,reATXHeadingMarker=/^#{1,6}(?:[ \t]+|$)/,reCodeFence=/^`{3,}(?!.*`)|^~{3,}/,reClosingCodeFence=/^(?:`{3,}|~{3,})(?= *$)/,reSetextHeadingLine=/^(?:=+|-+)[ \t]*$/,reLineEnding=/\r\n|\n|\r/,isSpaceOrTab=function(c){return 32===c||9===c},peek=function(ln,pos){return pos<ln.length?ln.charCodeAt(pos):-1},endsWithBlankLine=function(block){for(;block;){if(block._lastLineBlank)return!0;var t=block.type;if(block._lastLineChecked||"list"!==t&&"item"!==t){block._lastLineChecked=!0;break}block._lastLineChecked=!0,block=block._lastChild}return!1},addLine=function(){this.partiallyConsumedTab&&(this.offset+=1,this.tip._string_content+=" ".repeat(4-this.column%4));this.tip._string_content+=this.currentLine.slice(this.offset)+"\n"},addChild=function(tag,offset){for(;!this.blocks[this.tip.type].canContain(tag);)this.finalize(this.tip,this.lineNumber-1);var newBlock=new Node(tag,[[this.lineNumber,offset+1],[0,0]]);return newBlock._string_content="",this.tip.appendChild(newBlock),this.tip=newBlock},closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var parent=this.oldtip._parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=parent}this.allClosed=!0}},blocks={document:{continue:function(){return 0},finalize:function(){},canContain:function(t){return"item"!==t},acceptsLines:!1},list:{continue:function(){return 0},finalize:function(parser,block){for(var item=block._firstChild;item;){if(endsWithBlankLine(item)&&item._next){block._listData.tight=!1;break}for(var subitem=item._firstChild;subitem;){if(endsWithBlankLine(subitem)&&(item._next||subitem._next)){block._listData.tight=!1;break}subitem=subitem._next}item=item._next}},canContain:function(t){return"item"===t},acceptsLines:!1},block_quote:{continue:function(parser){var ln=parser.currentLine;return parser.indented||62!==peek(ln,parser.nextNonspace)?1:(parser.advanceNextNonspace(),parser.advanceOffset(1,!1),isSpaceOrTab(peek(ln,parser.offset))&&parser.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(t){return"item"!==t},acceptsLines:!1},item:{continue:function(parser,container){if(parser.blank){if(null==container._firstChild)return 1;parser.advanceNextNonspace()}else{if(!(container._listData.markerOffset+container._listData.padding<=parser.indent))return 1;parser.advanceOffset(contain
|