tildefriends/apps/journal/commonmark.min.js

2 lines
194 KiB
JavaScript
Raw Normal View History

2024-02-25 16:25:23 -05:00
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).commonmark={})}(this,function(e){"use strict";function j(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}function U(e,t){this.current=e,this.entering=!0===t}function M(){var e,t=this.current,r=this.entering;return null===t?null:(e=j(t),r&&e?t._firstChild?(this.current=t._firstChild,this.entering=!0):this.entering=!1:t===this.root?this.current=null:null===t._next?(this.current=t._parent,this.entering=!1):(this.current=t._next,this.entering=!0),{entering:r,node:t})}function B(e){return{current:e,root:e,entering:!0,next:M,resumeAt:U}}var b=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},t=b.prototype,H=(Object.defineProperty(t,"isContainer",{get:function(){return j(this)}}),Object.defineProperty(t,"type",{get:function(){return this._type}}),Object.defineProperty(t,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(t,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(t,"next",{get:function(){return this._next}}),Object.defineProperty(t,"prev",{get:function(){return this._prev}}),Object.defineProperty(t,"parent",{get:function(){return this._parent}}),Object.defineProperty(t,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(t,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(t,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(t,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(t,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(t,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(t,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(t,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(t,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(t,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(t,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(t,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),b.prototype.appendChild=function(e){e.unlink(),(e._parent=this)._lastChild?(this._lastChild._next=e)._prev=this._lastChild:this._firstChild=e,this._lastChild=e},b.prototype.prependChild=function(e){e.unlink(),(e._parent=this)._firstChild?((this._firstChild._prev=e)._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},b.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},b.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),((e._prev=this)._next=e)._parent=this._parent,e._next||(e._parent._lastChild=e)},b.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),((e._next=this)._prev=e)._parent=this._parent,e._prev||(e._parent._firstChild=e)},b.prototype.walker=fun