forked from q/element-web-patches
132 lines
467 KiB
Diff
132 lines
467 KiB
Diff
|
--- a/node_modules/commonmark/dist/commonmark.js
|
||
|
+++ b/node_modules/commonmark/dist/commonmark.js
|
||
|
@@ -11086,14 +11086,54 @@
|
||
|
|
||
|
function block_quote(node, entering) {
|
||
|
var attrs = this.attrs(node);
|
||
|
+
|
||
|
+ if (node.firstChild !== null) {
|
||
|
+ var w = node.walker(), e, m=node.firstChild
|
||
|
+
|
||
|
+ while (m.firstChild !== null) {
|
||
|
+ m = m.firstChild
|
||
|
+ }
|
||
|
+
|
||
|
+ while (m.type !== 'document') {
|
||
|
+ if (m.type == 'text' && m.literal[0] !== '>') {
|
||
|
+ m.literal = '>' + m.literal
|
||
|
+ }
|
||
|
+ m = m.parent
|
||
|
+ }
|
||
|
+
|
||
|
+ while (e = w.next()) {
|
||
|
+ const n = e.node
|
||
|
+
|
||
|
+ if (e.entering == false) {
|
||
|
+ continue
|
||
|
+ }
|
||
|
+
|
||
|
+ if (n.type == 'text') {
|
||
|
+ let o = n.parent
|
||
|
+
|
||
|
+ while (o.type !== 'document') {
|
||
|
+ if (o.type == 'block_quote') {
|
||
|
+ break
|
||
|
+ } else {
|
||
|
+ o = o.parent
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ if (o.type == 'block_quote' && (n.prev && n.prev.type == 'softbreak') && n.literal[0] !== '>') {
|
||
|
+ n.literal = '>' + n.literal
|
||
|
+ }
|
||
|
+ }
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
if (entering) {
|
||
|
- this.cr();
|
||
|
- this.tag("blockquote", attrs);
|
||
|
- this.cr();
|
||
|
+ this.tag('font', [...attrs, ['color', '#789922']]);
|
||
|
+
|
||
|
+ if (!node.firstChild) {
|
||
|
+ this.buffer += '<p>></p>'
|
||
|
+ }
|
||
|
} else {
|
||
|
- this.cr();
|
||
|
- this.tag("/blockquote");
|
||
|
- this.cr();
|
||
|
+ this.tag('/font');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
--- a/node_modules/commonmark/dist/commonmark.min.js
|
||
|
+++ b/node_modules/commonmark/dist/commonmark.min.js
|
||
|
@@ -1 +1 @@
|
||
|
-!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=fu
|
||
|
+(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=global||self,factory(global.commonmark={}))})(this,function(exports){"use strict";function isContainer(node){switch(node._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 true;default:return false}}var resumeAt=function(node,entering){this.current=node;this.entering=entering===true};var next=function(){var cur=this.current;var entering=this.entering;if(cur===null){return null}var container=isContainer(cur);if(entering&&container){if(cur._firstChild){this.current=cur._firstChild;this.entering=true}else{this.entering=false}}else if(cur===this.root){this.current=null}else if(cur._next===null){this.current=cur._parent;this.entering=false}else{this.current=cur._next;this.entering=true}return{entering:entering,node:cur}};var NodeWalker=function(root){return{current:root,root:root,entering:true,next:next,resumeAt:resumeAt}};var Node=function(nodeType,sourcepos){this._type=nodeType;this._parent=null;this._firstChild=null;this._lastChild=null;this._prev=null;this._next=null;this._sourcepos=sourcepos;this._open=true;this._string_content=null;this._literal=null;this._listData={};this._info=null;this._destination=null;this._title=null;this._isFenced=false;this._fenceChar=null;this._fenceLength=0;this._fenceOffset=null;this._level=null;this._onEnter=null;this._onExit=null};var proto=Node.prototype;Object.defineProperty(proto,"isContainer",{get:function(){return isContainer(this)}});Object.defineProperty(proto,"type",{get:function(){return this._type}});Object.defineProperty(proto,"firstChild",{get:function(){return this._firstChild}});Object.defineProperty(proto,"lastChild",{get:function(){return this._lastChild}});Object.defineProperty(proto,"next",{get:function(){return this._next}});Object.defineProperty(proto,"prev",{get:function(){return this._prev}});Object.defineProperty(proto,"parent",{get:function(){return this._parent}});Object.defineProperty(proto,"sourcepos",{get:function(){return this._sourcepos}});Object.defineProperty(proto,"literal",{get:function(){return this._literal},set:function(s){this._literal=s}});Object.defineProperty(proto,"destination",{get:function(){return this._destination},set:function(s){this._destination=s}});Object.defineProperty(proto,"title",{get:function(){return this._title},set:function(s){this._title=s}});Object.defineProperty(proto,"info",{get:function(){return this._info},set:function(s){this._info=s}});Object.defineProperty(proto,"level",{get:function(){return this._level},set:function(s){this._level=s}});Object.defineProperty(proto,"listType",{get:function(){return this._listData.type},set:function(t){this._listData.type=t}});Object.defineProperty(proto,"listTight",{get:function(){return this._listData.tight},set:function(t){this._listData.tight=t}});Object.defineProperty(proto,"listStart",{get:function(){return this._listData.start},set:function(n){this._listData.start=n}});Object.defineProperty(proto,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(delim){this._listData.delimiter=delim}});Object.defineProperty(proto,"onEnter",{get:function(){return this._onEnter},set:function(s){this._onEnter=s}});Object.defineProperty(proto,"onExit",{get:function(){return this._onExit},set:function(s){this._onExit=s}});Node.prototype.appendChild=function(child){child.unlink();child._parent=this;if(this._lastChild){this._lastChild._next=child;child._prev=this._lastChild;this._lastChild=child}else{this._firstChild=child;this._lastChild=child}};Node.prototype.prependChild=function(child){child.unlink();child._parent=this;if(this._firstChild){this._firstChild._prev=child;child._next=this._firstChild;this._firstChild=child}else{this._firstChild=child;this._lastChild=child}};Node.prototype.unlink=function(){if(this._prev){this._prev._next=this._next}else if(this._parent){this._p
|
||
|
--- a/node_modules/commonmark/lib/render/html.js
|
||
|
+++ b/node_modules/commonmark/lib/render/html.js
|
||
|
@@ -168,14 +168,54 @@
|
||
|
|
||
|
function block_quote(node, entering) {
|
||
|
var attrs = this.attrs(node);
|
||
|
+
|
||
|
+ if (node.firstChild !== null) {
|
||
|
+ var w = node.walker(), e, m=node.firstChild
|
||
|
+
|
||
|
+ while (m.firstChild !== null) {
|
||
|
+ m = m.firstChild
|
||
|
+ }
|
||
|
+
|
||
|
+ while (m.type !== 'document') {
|
||
|
+ if (m.type == 'text' && m.literal[0] !== '>') {
|
||
|
+ m.literal = '>' + m.literal
|
||
|
+ }
|
||
|
+ m = m.parent
|
||
|
+ }
|
||
|
+
|
||
|
+ while (e = w.next()) {
|
||
|
+ const n = e.node
|
||
|
+
|
||
|
+ if (e.entering == false) {
|
||
|
+ continue
|
||
|
+ }
|
||
|
+
|
||
|
+ if (n.type == 'text') {
|
||
|
+ let o = n.parent
|
||
|
+
|
||
|
+ while (o.type !== 'document') {
|
||
|
+ if (o.type == 'block_quote') {
|
||
|
+ break
|
||
|
+ } else {
|
||
|
+ o = o.parent
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ if (o.type == 'block_quote' && (n.prev && n.prev.type == 'softbreak') && n.literal[0] !== '>') {
|
||
|
+ n.literal = '>' + n.literal
|
||
|
+ }
|
||
|
+ }
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
if (entering) {
|
||
|
- this.cr();
|
||
|
- this.tag("blockquote", attrs);
|
||
|
- this.cr();
|
||
|
+ this.tag('font', [...attrs, ['color', '#789922']]);
|
||
|
+
|
||
|
+ if (!node.firstChild) {
|
||
|
+ this.buffer += '<p>></p>'
|
||
|
+ }
|
||
|
} else {
|
||
|
- this.cr();
|
||
|
- this.tag("/blockquote");
|
||
|
- this.cr();
|
||
|
+ this.tag('/font');
|
||
|
}
|
||
|
}
|
||
|
|