tildefriends/apps/journal/commonmark.min.js

2 lines
176 KiB
JavaScript
Raw Normal View History

2024-10-08 20:40:29 -04:00
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).commonmark={})}(this,function(e){"use strict";function i(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 B(e,r){this.current=e,this.entering=!0===r}function H(){var e,r=this.current,t=this.entering;return null===r?null:(e=i(r),t&&e?r._firstChild?(this.current=r._firstChild,this.entering=!0):this.entering=!1:r===this.root?this.current=null:null===r._next?(this.current=r._parent,this.entering=!1):(this.current=r._next,this.entering=!0),{entering:t,node:r})}function O(e){return{current:e,root:e,entering:!0,next:H,resumeAt:B}}var b=function(e,r){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=r,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},r=b.prototype,l=(Object.defineProperty(r,"isContainer",{get:function(){return i(this)}}),Object.defineProperty(r,"type",{get:function(){return this._type}}),Object.defineProperty(r,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(r,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(r,"next",{get:function(){return this._next}}),Object.defineProperty(r,"prev",{get:function(){return this._prev}}),Object.defineProperty(r,"parent",{get:function(){return this._parent}}),Object.defineProperty(r,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(r,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(r,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(r,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(r,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(r,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(r,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(r,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(r,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(r,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(r,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(r,"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