init
This commit is contained in:
93
wx05cb767e6530b48f/wxParse/html2json.js
Normal file
93
wx05cb767e6530b48f/wxParse/html2json.js
Normal file
@@ -0,0 +1,93 @@
|
||||
function e(e) {
|
||||
for (var t = {}, r = e.split(","), s = 0; s < r.length; s++) t[r[s]] = !0;
|
||||
return t;
|
||||
}
|
||||
|
||||
function t(e) {
|
||||
var t = [];
|
||||
if (0 == r.length || !a) return (d = {}).node = "text", d.text = e, [ d ];
|
||||
e = e.replace(/\[([^\[\]]+)\]/g, ":$1:");
|
||||
for (var o = new RegExp("[:]"), n = e.split(o), i = 0; i < n.length; i++) {
|
||||
var l = n[i], d = {};
|
||||
a[l] ? (d.node = "element", d.tag = "emoji", d.text = a[l], d.baseSrc = s) : (d.node = "text",
|
||||
d.text = l), t.push(d);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
var r = "", s = "", a = {}, o = require("./wxDiscode.js"), n = require("./htmlparser.js"), i = (e("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),
|
||||
e("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video")), l = e("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"), d = e("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
|
||||
|
||||
e("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),
|
||||
e("wxxxcode-style,script,style,view,scroll-view,block"), module.exports = {
|
||||
html2json: function(e, r) {
|
||||
e = function(e) {
|
||||
return e.replace(/<\?xml.*\?>\n/, "").replace(/<.*!doctype.*\>\n/, "").replace(/<.*!DOCTYPE.*\>\n/, "");
|
||||
}(e), e = o.strDiscode(e);
|
||||
var s = [], a = {
|
||||
node: r,
|
||||
nodes: [],
|
||||
images: [],
|
||||
imageUrls: []
|
||||
};
|
||||
return n(e, {
|
||||
start: function(e, t, n) {
|
||||
var c = {
|
||||
node: "element",
|
||||
tag: e
|
||||
};
|
||||
if (i[e] ? c.tagType = "block" : l[e] ? c.tagType = "inline" : d[e] && (c.tagType = "closeSelf"),
|
||||
0 !== t.length && (c.attr = t.reduce(function(e, t) {
|
||||
var r = t.name, s = t.value;
|
||||
return "class" == r && (console.log(s), c.classStr = s), "style" == r && (console.log(s),
|
||||
c.styleStr = s), s.match(/ /) && (s = s.split(" ")), e[r] ? Array.isArray(e[r]) ? e[r].push(s) : e[r] = [ e[r], s ] : e[r] = s,
|
||||
e;
|
||||
}, {})), "img" === c.tag) {
|
||||
c.imgIndex = a.images.length;
|
||||
var u = c.attr.src;
|
||||
u = o.urlToHttpUrl(u, "https"), c.attr.src = u, c.from = r, a.images.push(c), a.imageUrls.push(u);
|
||||
}
|
||||
if ("font" === c.tag) {
|
||||
var p = [ "x-small", "small", "medium", "large", "x-large", "xx-large", "-webkit-xxx-large" ], m = {
|
||||
color: "color",
|
||||
face: "font-family",
|
||||
size: "font-size"
|
||||
};
|
||||
for (var f in c.attr.style || (c.attr.style = []), c.styleStr || (c.styleStr = ""),
|
||||
m) if (c.attr[f]) {
|
||||
var h = "size" === f ? p[c.attr[f] - 1] : c.attr[f];
|
||||
c.attr.style.push(m[f]), c.attr.style.push(h), c.styleStr += m[f] + ": " + h + ";";
|
||||
}
|
||||
}
|
||||
if ("source" === c.tag && (a.source = c.attr.src), n) {
|
||||
var g = s[0] || a;
|
||||
void 0 === g.nodes && (g.nodes = []), g.nodes.push(c);
|
||||
} else s.unshift(c);
|
||||
},
|
||||
end: function(e) {
|
||||
var t = s.shift();
|
||||
if (t.tag !== e && console.error("invalid state: mismatch end tag"), "video" === t.tag && a.source && (t.attr.src = a.source,
|
||||
delete result.source), 0 === s.length) a.nodes.push(t); else {
|
||||
var r = s[0];
|
||||
void 0 === r.nodes && (r.nodes = []), r.nodes.push(t);
|
||||
}
|
||||
},
|
||||
chars: function(e) {
|
||||
var r = {
|
||||
node: "text",
|
||||
text: e,
|
||||
textArray: t(e)
|
||||
};
|
||||
if (0 === s.length) a.nodes.push(r); else {
|
||||
var o = s[0];
|
||||
void 0 === o.nodes && (o.nodes = []), o.nodes.push(r);
|
||||
}
|
||||
},
|
||||
comment: function(e) {}
|
||||
}), a;
|
||||
},
|
||||
emojisInit: function() {
|
||||
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "/wxParse/emojis/", o = arguments[2];
|
||||
r = e, s = t, a = o;
|
||||
}
|
||||
};
|
||||
48
wx05cb767e6530b48f/wxParse/htmlparser.js
Normal file
48
wx05cb767e6530b48f/wxParse/htmlparser.js
Normal file
@@ -0,0 +1,48 @@
|
||||
function e(e) {
|
||||
for (var t = {}, r = e.split(","), s = 0; s < r.length; s++) t[r[s]] = !0;
|
||||
return t;
|
||||
}
|
||||
|
||||
var t = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, r = /^<\/([-A-Za-z0-9_]+)[^>]*>/, s = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g, a = e("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"), n = e("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"), i = e("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"), o = e("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), l = e("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"), c = e("wxxxcode-style,script,style,view,scroll-view,block");
|
||||
|
||||
module.exports = function(e, d) {
|
||||
function f(e, t) {
|
||||
if (t) for (t = t.toLowerCase(), r = b.length - 1; r >= 0 && b[r] != t; r--) ; else var r = 0;
|
||||
if (r >= 0) {
|
||||
for (var s = b.length - 1; s >= r; s--) d.end && d.end(b[s]);
|
||||
b.length = r;
|
||||
}
|
||||
}
|
||||
var p, u, h, b = [], m = e;
|
||||
for (b.last = function() {
|
||||
return this[this.length - 1];
|
||||
}; e; ) {
|
||||
if (u = !0, b.last() && c[b.last()]) e = e.replace(new RegExp("([\\s\\S]*?)</" + b.last() + "[^>]*>"), function(e, t) {
|
||||
return t = t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2"), d.chars && d.chars(t),
|
||||
"";
|
||||
}), f(0, b.last()); else if (0 == e.indexOf("\x3c!--") ? (p = e.indexOf("--\x3e")) >= 0 && (d.comment && d.comment(e.substring(4, p)),
|
||||
e = e.substring(p + 3), u = !1) : 0 == e.indexOf("</") ? (h = e.match(r)) && (e = e.substring(h[0].length),
|
||||
h[0].replace(r, f), u = !1) : 0 == e.indexOf("<") && (h = e.match(t)) && (e = e.substring(h[0].length),
|
||||
h[0].replace(t, function(e, t, r, c) {
|
||||
if (t = t.toLowerCase(), n[t]) for (;b.last() && i[b.last()]; ) f(0, b.last());
|
||||
if (o[t] && b.last() == t && f(0, t), (c = a[t] || !!c) || b.push(t), d.start) {
|
||||
var p = [];
|
||||
r.replace(s, function(e, t) {
|
||||
var r = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : l[t] ? t : "";
|
||||
p.push({
|
||||
name: t,
|
||||
value: r,
|
||||
escaped: r.replace(/(^|[^\\])"/g, '$1\\"')
|
||||
});
|
||||
}), d.start && d.start(t, p, c);
|
||||
}
|
||||
}), u = !1), u) {
|
||||
p = e.indexOf("<");
|
||||
for (var g = ""; 0 === p; ) g += "<", p = (e = e.substring(1)).indexOf("<");
|
||||
g += p < 0 ? e : e.substring(0, p), e = p < 0 ? "" : e.substring(p), d.chars && d.chars(g);
|
||||
}
|
||||
if (e == m) throw "Parse Error: " + e;
|
||||
m = e;
|
||||
}
|
||||
f();
|
||||
};
|
||||
678
wx05cb767e6530b48f/wxParse/showdown.js
Normal file
678
wx05cb767e6530b48f/wxParse/showdown.js
Normal file
@@ -0,0 +1,678 @@
|
||||
var e = require("../@babel/runtime/helpers/typeof");
|
||||
|
||||
function r(e) {
|
||||
var r = {
|
||||
omitExtraWLInCodeBlocks: {
|
||||
defaultValue: !1,
|
||||
describe: "Omit the default extra whiteline added to code blocks",
|
||||
type: "boolean"
|
||||
},
|
||||
noHeaderId: {
|
||||
defaultValue: !1,
|
||||
describe: "Turn on/off generated header id",
|
||||
type: "boolean"
|
||||
},
|
||||
prefixHeaderId: {
|
||||
defaultValue: !1,
|
||||
describe: "Specify a prefix to generated header ids",
|
||||
type: "string"
|
||||
},
|
||||
headerLevelStart: {
|
||||
defaultValue: !1,
|
||||
describe: "The header blocks level start",
|
||||
type: "integer"
|
||||
},
|
||||
parseImgDimensions: {
|
||||
defaultValue: !1,
|
||||
describe: "Turn on/off image dimension parsing",
|
||||
type: "boolean"
|
||||
},
|
||||
simplifiedAutoLink: {
|
||||
defaultValue: !1,
|
||||
describe: "Turn on/off GFM autolink style",
|
||||
type: "boolean"
|
||||
},
|
||||
literalMidWordUnderscores: {
|
||||
defaultValue: !1,
|
||||
describe: "Parse midword underscores as literal underscores",
|
||||
type: "boolean"
|
||||
},
|
||||
strikethrough: {
|
||||
defaultValue: !1,
|
||||
describe: "Turn on/off strikethrough support",
|
||||
type: "boolean"
|
||||
},
|
||||
tables: {
|
||||
defaultValue: !1,
|
||||
describe: "Turn on/off tables support",
|
||||
type: "boolean"
|
||||
},
|
||||
tablesHeaderId: {
|
||||
defaultValue: !1,
|
||||
describe: "Add an id to table headers",
|
||||
type: "boolean"
|
||||
},
|
||||
ghCodeBlocks: {
|
||||
defaultValue: !0,
|
||||
describe: "Turn on/off GFM fenced code blocks support",
|
||||
type: "boolean"
|
||||
},
|
||||
tasklists: {
|
||||
defaultValue: !1,
|
||||
describe: "Turn on/off GFM tasklist support",
|
||||
type: "boolean"
|
||||
},
|
||||
smoothLivePreview: {
|
||||
defaultValue: !1,
|
||||
describe: "Prevents weird effects in live previews due to incomplete input",
|
||||
type: "boolean"
|
||||
},
|
||||
smartIndentationFix: {
|
||||
defaultValue: !1,
|
||||
description: "Tries to smartly fix identation in es6 strings",
|
||||
type: "boolean"
|
||||
}
|
||||
};
|
||||
if (!1 === e) return JSON.parse(JSON.stringify(r));
|
||||
var t = {};
|
||||
for (var n in r) r.hasOwnProperty(n) && (t[n] = r[n].defaultValue);
|
||||
return t;
|
||||
}
|
||||
|
||||
function t(e, r) {
|
||||
var t = r ? "Error in " + r + " extension->" : "Error in unnamed extension", n = {
|
||||
valid: !0,
|
||||
error: ""
|
||||
};
|
||||
a.helper.isArray(e) || (e = [ e ]);
|
||||
for (var o = 0; o < e.length; ++o) {
|
||||
var i = t + " sub-extension " + o + ": ", l = e[o];
|
||||
if ("object" !== (void 0 === l ? "undefined" : s(l))) return n.valid = !1, n.error = i + "must be an object, but " + (void 0 === l ? "undefined" : s(l)) + " given",
|
||||
n;
|
||||
if (!a.helper.isString(l.type)) return n.valid = !1, n.error = i + 'property "type" must be a string, but ' + s(l.type) + " given",
|
||||
n;
|
||||
var c = l.type = l.type.toLowerCase();
|
||||
if ("language" === c && (c = l.type = "lang"), "html" === c && (c = l.type = "output"),
|
||||
"lang" !== c && "output" !== c && "listener" !== c) return n.valid = !1, n.error = i + "type " + c + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"',
|
||||
n;
|
||||
if ("listener" === c) {
|
||||
if (a.helper.isUndefined(l.listeners)) return n.valid = !1, n.error = i + '. Extensions of type "listener" must have a property called "listeners"',
|
||||
n;
|
||||
} else if (a.helper.isUndefined(l.filter) && a.helper.isUndefined(l.regex)) return n.valid = !1,
|
||||
n.error = i + c + ' extensions must define either a "regex" property or a "filter" method',
|
||||
n;
|
||||
if (l.listeners) {
|
||||
if ("object" !== s(l.listeners)) return n.valid = !1, n.error = i + '"listeners" property must be an object but ' + s(l.listeners) + " given",
|
||||
n;
|
||||
for (var u in l.listeners) if (l.listeners.hasOwnProperty(u) && "function" != typeof l.listeners[u]) return n.valid = !1,
|
||||
n.error = i + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + u + " must be a function but " + s(l.listeners[u]) + " given",
|
||||
n;
|
||||
}
|
||||
if (l.filter) {
|
||||
if ("function" != typeof l.filter) return n.valid = !1, n.error = i + '"filter" must be a function, but ' + s(l.filter) + " given",
|
||||
n;
|
||||
} else if (l.regex) {
|
||||
if (a.helper.isString(l.regex) && (l.regex = new RegExp(l.regex, "g")), !l.regex instanceof RegExp) return n.valid = !1,
|
||||
n.error = i + '"regex" property must either be a string or a RegExp object, but ' + s(l.regex) + " given",
|
||||
n;
|
||||
if (a.helper.isUndefined(l.replace)) return n.valid = !1, n.error = i + '"regex" extensions must implement a replace string or function',
|
||||
n;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
function n(e, r) {
|
||||
return "~E" + r.charCodeAt(0) + "E";
|
||||
}
|
||||
|
||||
var s = "function" == typeof Symbol && "symbol" == e(Symbol.iterator) ? function(r) {
|
||||
return e(r);
|
||||
} : function(r) {
|
||||
return r && "function" == typeof Symbol && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : e(r);
|
||||
}, a = {}, o = {}, i = {}, l = r(!0), c = {
|
||||
github: {
|
||||
omitExtraWLInCodeBlocks: !0,
|
||||
prefixHeaderId: "user-content-",
|
||||
simplifiedAutoLink: !0,
|
||||
literalMidWordUnderscores: !0,
|
||||
strikethrough: !0,
|
||||
tables: !0,
|
||||
tablesHeaderId: !0,
|
||||
ghCodeBlocks: !0,
|
||||
tasklists: !0
|
||||
},
|
||||
vanilla: r(!0)
|
||||
};
|
||||
|
||||
a.helper = {}, a.extensions = {}, a.setOption = function(e, r) {
|
||||
return l[e] = r, this;
|
||||
}, a.getOption = function(e) {
|
||||
return l[e];
|
||||
}, a.getOptions = function() {
|
||||
return l;
|
||||
}, a.resetOptions = function() {
|
||||
l = r(!0);
|
||||
}, a.setFlavor = function(e) {
|
||||
if (c.hasOwnProperty(e)) {
|
||||
var r = c[e];
|
||||
for (var t in r) r.hasOwnProperty(t) && (l[t] = r[t]);
|
||||
}
|
||||
}, a.getDefaultOptions = function(e) {
|
||||
return r(e);
|
||||
}, a.subParser = function(e, r) {
|
||||
if (a.helper.isString(e)) {
|
||||
if (void 0 === r) {
|
||||
if (o.hasOwnProperty(e)) return o[e];
|
||||
throw Error("SubParser named " + e + " not registered!");
|
||||
}
|
||||
o[e] = r;
|
||||
}
|
||||
}, a.extension = function(e, r) {
|
||||
if (!a.helper.isString(e)) throw Error("Extension 'name' must be a string");
|
||||
if (e = a.helper.stdExtName(e), a.helper.isUndefined(r)) {
|
||||
if (!i.hasOwnProperty(e)) throw Error("Extension named " + e + " is not registered!");
|
||||
return i[e];
|
||||
}
|
||||
"function" == typeof r && (r = r()), a.helper.isArray(r) || (r = [ r ]);
|
||||
var n = t(r, e);
|
||||
if (!n.valid) throw Error(n.error);
|
||||
i[e] = r;
|
||||
}, a.getAllExtensions = function() {
|
||||
return i;
|
||||
}, a.removeExtension = function(e) {
|
||||
delete i[e];
|
||||
}, a.resetExtensions = function() {
|
||||
i = {};
|
||||
}, a.validateExtension = function(e) {
|
||||
var r = t(e, null);
|
||||
return !!r.valid || (console.warn(r.error), !1);
|
||||
}, a.hasOwnProperty("helper") || (a.helper = {}), a.helper.isString = function(e) {
|
||||
return "string" == typeof e || e instanceof String;
|
||||
}, a.helper.isFunction = function(e) {
|
||||
return e && "[object Function]" === {}.toString.call(e);
|
||||
}, a.helper.forEach = function(e, r) {
|
||||
if ("function" == typeof e.forEach) e.forEach(r); else for (var t = 0; t < e.length; t++) r(e[t], t, e);
|
||||
}, a.helper.isArray = function(e) {
|
||||
return e.constructor === Array;
|
||||
}, a.helper.isUndefined = function(e) {
|
||||
return void 0 === e;
|
||||
}, a.helper.stdExtName = function(e) {
|
||||
return e.replace(/[_-]||\s/g, "").toLowerCase();
|
||||
}, a.helper.escapeCharactersCallback = n, a.helper.escapeCharacters = function(e, r, t) {
|
||||
var s = "([" + r.replace(/([\[\]\\])/g, "\\$1") + "])";
|
||||
t && (s = "\\\\" + s);
|
||||
var a = new RegExp(s, "g");
|
||||
return e.replace(a, n);
|
||||
};
|
||||
|
||||
var u = function(e, r, t, n) {
|
||||
var s, a, o, i, l, c = n || "", u = c.indexOf("g") > -1, p = new RegExp(r + "|" + t, "g" + c.replace(/g/g, "")), h = new RegExp(r, c.replace(/g/g, "")), d = [];
|
||||
do {
|
||||
for (s = 0; o = p.exec(e); ) if (h.test(o[0])) s++ || (i = (a = p.lastIndex) - o[0].length); else if (s && !--s) {
|
||||
l = o.index + o[0].length;
|
||||
var f = {
|
||||
left: {
|
||||
start: i,
|
||||
end: a
|
||||
},
|
||||
match: {
|
||||
start: a,
|
||||
end: o.index
|
||||
},
|
||||
right: {
|
||||
start: o.index,
|
||||
end: l
|
||||
},
|
||||
wholeMatch: {
|
||||
start: i,
|
||||
end: l
|
||||
}
|
||||
};
|
||||
if (d.push(f), !u) return d;
|
||||
}
|
||||
} while (s && (p.lastIndex = a));
|
||||
return d;
|
||||
};
|
||||
|
||||
a.helper.matchRecursiveRegExp = function(e, r, t, n) {
|
||||
for (var s = u(e, r, t, n), a = [], o = 0; o < s.length; ++o) a.push([ e.slice(s[o].wholeMatch.start, s[o].wholeMatch.end), e.slice(s[o].match.start, s[o].match.end), e.slice(s[o].left.start, s[o].left.end), e.slice(s[o].right.start, s[o].right.end) ]);
|
||||
return a;
|
||||
}, a.helper.replaceRecursiveRegExp = function(e, r, t, n, s) {
|
||||
if (!a.helper.isFunction(r)) {
|
||||
var o = r;
|
||||
r = function() {
|
||||
return o;
|
||||
};
|
||||
}
|
||||
var i = u(e, t, n, s), l = e, c = i.length;
|
||||
if (c > 0) {
|
||||
var p = [];
|
||||
0 !== i[0].wholeMatch.start && p.push(e.slice(0, i[0].wholeMatch.start));
|
||||
for (var h = 0; h < c; ++h) p.push(r(e.slice(i[h].wholeMatch.start, i[h].wholeMatch.end), e.slice(i[h].match.start, i[h].match.end), e.slice(i[h].left.start, i[h].left.end), e.slice(i[h].right.start, i[h].right.end))),
|
||||
h < c - 1 && p.push(e.slice(i[h].wholeMatch.end, i[h + 1].wholeMatch.start));
|
||||
i[c - 1].wholeMatch.end < e.length && p.push(e.slice(i[c - 1].wholeMatch.end)),
|
||||
l = p.join("");
|
||||
}
|
||||
return l;
|
||||
}, a.helper.isUndefined(console) && (console = {
|
||||
warn: function(e) {
|
||||
alert(e);
|
||||
},
|
||||
log: function(e) {
|
||||
alert(e);
|
||||
},
|
||||
error: function(e) {
|
||||
throw e;
|
||||
}
|
||||
}), a.Converter = function(e) {
|
||||
function r(e, r) {
|
||||
if (r = r || null, a.helper.isString(e)) {
|
||||
if (r = e = a.helper.stdExtName(e), a.extensions[e]) return console.warn("DEPRECATION WARNING: " + e + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),
|
||||
void function(e, r) {
|
||||
"function" == typeof e && (e = e(new a.Converter())), a.helper.isArray(e) || (e = [ e ]);
|
||||
var n = t(e, r);
|
||||
if (!n.valid) throw Error(n.error);
|
||||
for (var s = 0; s < e.length; ++s) switch (e[s].type) {
|
||||
case "lang":
|
||||
u.push(e[s]);
|
||||
break;
|
||||
|
||||
case "output":
|
||||
p.push(e[s]);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw Error("Extension loader error: Type unrecognized!!!");
|
||||
}
|
||||
}(a.extensions[e], e);
|
||||
if (a.helper.isUndefined(i[e])) throw Error('Extension "' + e + '" could not be loaded. It was either not found or is not a valid extension.');
|
||||
e = i[e];
|
||||
}
|
||||
"function" == typeof e && (e = e()), a.helper.isArray(e) || (e = [ e ]);
|
||||
var s = t(e, r);
|
||||
if (!s.valid) throw Error(s.error);
|
||||
for (var o = 0; o < e.length; ++o) {
|
||||
switch (e[o].type) {
|
||||
case "lang":
|
||||
u.push(e[o]);
|
||||
break;
|
||||
|
||||
case "output":
|
||||
p.push(e[o]);
|
||||
}
|
||||
if (e[o].hasOwnProperty(h)) for (var l in e[o].listeners) e[o].listeners.hasOwnProperty(l) && n(l, e[o].listeners[l]);
|
||||
}
|
||||
}
|
||||
function n(e, r) {
|
||||
if (!a.helper.isString(e)) throw Error("Invalid argument in converter.listen() method: name must be a string, but " + (void 0 === e ? "undefined" : s(e)) + " given");
|
||||
if ("function" != typeof r) throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + (void 0 === r ? "undefined" : s(r)) + " given");
|
||||
h.hasOwnProperty(e) || (h[e] = []), h[e].push(r);
|
||||
}
|
||||
var o = {}, u = [], p = [], h = {};
|
||||
!function() {
|
||||
for (var t in e = e || {}, l) l.hasOwnProperty(t) && (o[t] = l[t]);
|
||||
if ("object" !== (void 0 === e ? "undefined" : s(e))) throw Error("Converter expects the passed parameter to be an object, but " + (void 0 === e ? "undefined" : s(e)) + " was passed instead.");
|
||||
for (var n in e) e.hasOwnProperty(n) && (o[n] = e[n]);
|
||||
o.extensions && a.helper.forEach(o.extensions, r);
|
||||
}(), this._dispatch = function(e, r, t, n) {
|
||||
if (h.hasOwnProperty(e)) for (var s = 0; s < h[e].length; ++s) {
|
||||
var a = h[e][s](e, r, this, t, n);
|
||||
a && void 0 !== a && (r = a);
|
||||
}
|
||||
return r;
|
||||
}, this.listen = function(e, r) {
|
||||
return n(e, r), this;
|
||||
}, this.makeHtml = function(e) {
|
||||
if (!e) return e;
|
||||
var r = {
|
||||
gHtmlBlocks: [],
|
||||
gHtmlMdBlocks: [],
|
||||
gHtmlSpans: [],
|
||||
gUrls: {},
|
||||
gTitles: {},
|
||||
gDimensions: {},
|
||||
gListLevel: 0,
|
||||
hashLinkCounts: {},
|
||||
langExtensions: u,
|
||||
outputModifiers: p,
|
||||
converter: this,
|
||||
ghCodeBlocks: []
|
||||
};
|
||||
return e = (e = (e = (e = e.replace(/~/g, "~T")).replace(/\$/g, "~D")).replace(/\r\n/g, "\n")).replace(/\r/g, "\n"),
|
||||
o.smartIndentationFix && (e = function(e) {
|
||||
var r = e.match(/^\s*/)[0].length, t = new RegExp("^\\s{0," + r + "}", "gm");
|
||||
return e.replace(t, "");
|
||||
}(e)), e = e, e = a.subParser("detab")(e, o, r), e = a.subParser("stripBlankLines")(e, o, r),
|
||||
a.helper.forEach(u, function(t) {
|
||||
e = a.subParser("runExtension")(t, e, o, r);
|
||||
}), e = a.subParser("hashPreCodeTags")(e, o, r), e = a.subParser("githubCodeBlocks")(e, o, r),
|
||||
e = a.subParser("hashHTMLBlocks")(e, o, r), e = a.subParser("hashHTMLSpans")(e, o, r),
|
||||
e = a.subParser("stripLinkDefinitions")(e, o, r), e = a.subParser("blockGamut")(e, o, r),
|
||||
e = a.subParser("unhashHTMLSpans")(e, o, r), e = (e = (e = a.subParser("unescapeSpecialChars")(e, o, r)).replace(/~D/g, "$$")).replace(/~T/g, "~"),
|
||||
a.helper.forEach(p, function(t) {
|
||||
e = a.subParser("runExtension")(t, e, o, r);
|
||||
}), e;
|
||||
}, this.setOption = function(e, r) {
|
||||
o[e] = r;
|
||||
}, this.getOption = function(e) {
|
||||
return o[e];
|
||||
}, this.getOptions = function() {
|
||||
return o;
|
||||
}, this.addExtension = function(e, t) {
|
||||
r(e, t = t || null);
|
||||
}, this.useExtension = function(e) {
|
||||
r(e);
|
||||
}, this.setFlavor = function(e) {
|
||||
if (c.hasOwnProperty(e)) {
|
||||
var r = c[e];
|
||||
for (var t in r) r.hasOwnProperty(t) && (o[t] = r[t]);
|
||||
}
|
||||
}, this.removeExtension = function(e) {
|
||||
a.helper.isArray(e) || (e = [ e ]);
|
||||
for (var r = 0; r < e.length; ++r) {
|
||||
for (var t = e[r], n = 0; n < u.length; ++n) u[n] === t && u[n].splice(n, 1);
|
||||
for (;0 < p.length; ++n) p[0] === t && p[0].splice(n, 1);
|
||||
}
|
||||
}, this.getAllExtensions = function() {
|
||||
return {
|
||||
language: u,
|
||||
output: p
|
||||
};
|
||||
};
|
||||
}, a.subParser("anchors", function(e, r, t) {
|
||||
var n = function(e, r, n, s, o, i, l, c) {
|
||||
a.helper.isUndefined(c) && (c = ""), e = r;
|
||||
var u = n, p = s.toLowerCase(), h = o, d = c;
|
||||
if (!h) if (p || (p = u.toLowerCase().replace(/ ?\n/g, " ")), h = "#" + p, a.helper.isUndefined(t.gUrls[p])) {
|
||||
if (!(e.search(/\(\s*\)$/m) > -1)) return e;
|
||||
h = "";
|
||||
} else h = t.gUrls[p], a.helper.isUndefined(t.gTitles[p]) || (d = t.gTitles[p]);
|
||||
var f = '<a href="' + (h = a.helper.escapeCharacters(h, "*_", !1)) + '"';
|
||||
return "" !== d && null !== d && (d = d.replace(/"/g, """), f += ' title="' + (d = a.helper.escapeCharacters(d, "*_", !1)) + '"'),
|
||||
f + ">" + u + "</a>";
|
||||
};
|
||||
return e = (e = (e = (e = t.converter._dispatch("anchors.before", e, r, t)).replace(/(\[((?:\[[^\]]*]|[^\[\]])*)][ ]?(?:\n[ ]*)?\[(.*?)])()()()()/g, n)).replace(/(\[((?:\[[^\]]*]|[^\[\]])*)]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, n)).replace(/(\[([^\[\]]+)])()()()()()/g, n),
|
||||
t.converter._dispatch("anchors.after", e, r, t);
|
||||
}), a.subParser("autoLinks", function(e, r, t) {
|
||||
function n(e, r) {
|
||||
var t = r;
|
||||
return /^www\./i.test(r) && (r = r.replace(/^www\./i, "http://www.")), '<a href="' + r + '">' + t + "</a>";
|
||||
}
|
||||
function s(e, r) {
|
||||
var t = a.subParser("unescapeSpecialChars")(r);
|
||||
return a.subParser("encodeEmailAddress")(t);
|
||||
}
|
||||
return e = (e = (e = t.converter._dispatch("autoLinks.before", e, r, t)).replace(/<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)>/gi, n)).replace(/<(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, s),
|
||||
r.simplifiedAutoLink && (e = (e = e.replace(/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)(?=\s|$)(?!["<>])/gi, n)).replace(/(?:^|[ \n\t])([A-Za-z0-9!#$%&'*+-/=?^_`\{|}~\.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?:$|[ \n\t])/gi, s)),
|
||||
t.converter._dispatch("autoLinks.after", e, r, t);
|
||||
}), a.subParser("blockGamut", function(e, r, t) {
|
||||
e = t.converter._dispatch("blockGamut.before", e, r, t), e = a.subParser("blockQuotes")(e, r, t),
|
||||
e = a.subParser("headers")(e, r, t);
|
||||
var n = a.subParser("hashBlock")("<hr />", r, t);
|
||||
return e = (e = (e = e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, n)).replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, n)).replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, n),
|
||||
e = a.subParser("lists")(e, r, t), e = a.subParser("codeBlocks")(e, r, t), e = a.subParser("tables")(e, r, t),
|
||||
e = a.subParser("hashHTMLBlocks")(e, r, t), e = a.subParser("paragraphs")(e, r, t),
|
||||
t.converter._dispatch("blockGamut.after", e, r, t);
|
||||
}), a.subParser("blockQuotes", function(e, r, t) {
|
||||
return e = (e = t.converter._dispatch("blockQuotes.before", e, r, t)).replace(/((^[ \t]{0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function(e, n) {
|
||||
var s = n;
|
||||
return s = (s = (s = s.replace(/^[ \t]*>[ \t]?/gm, "~0")).replace(/~0/g, "")).replace(/^[ \t]+$/gm, ""),
|
||||
s = a.subParser("githubCodeBlocks")(s, r, t), s = (s = (s = a.subParser("blockGamut")(s, r, t)).replace(/(^|\n)/g, "$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(e, r) {
|
||||
var t = r;
|
||||
return (t = t.replace(/^ /gm, "~0")).replace(/~0/g, "");
|
||||
}), a.subParser("hashBlock")("<blockquote>\n" + s + "\n</blockquote>", r, t);
|
||||
}), t.converter._dispatch("blockQuotes.after", e, r, t);
|
||||
}), a.subParser("codeBlocks", function(e, r, t) {
|
||||
e = t.converter._dispatch("codeBlocks.before", e, r, t);
|
||||
return e = (e = (e += "~0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g, function(e, n, s) {
|
||||
var o = n, i = s, l = "\n";
|
||||
return o = a.subParser("outdent")(o), o = a.subParser("encodeCode")(o), o = (o = (o = a.subParser("detab")(o)).replace(/^\n+/g, "")).replace(/\n+$/g, ""),
|
||||
r.omitExtraWLInCodeBlocks && (l = ""), o = "<pre><code>" + o + l + "</code></pre>",
|
||||
a.subParser("hashBlock")(o, r, t) + i;
|
||||
})).replace(/~0/, ""), t.converter._dispatch("codeBlocks.after", e, r, t);
|
||||
}), a.subParser("codeSpans", function(e, r, t) {
|
||||
return void 0 === (e = t.converter._dispatch("codeSpans.before", e, r, t)) && (e = ""),
|
||||
e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, r, t, n) {
|
||||
var s = n;
|
||||
return s = (s = s.replace(/^([ \t]*)/g, "")).replace(/[ \t]*$/g, ""), r + "<code>" + (s = a.subParser("encodeCode")(s)) + "</code>";
|
||||
}), t.converter._dispatch("codeSpans.after", e, r, t);
|
||||
}), a.subParser("detab", function(e) {
|
||||
return (e = (e = (e = (e = e.replace(/\t(?=\t)/g, " ")).replace(/\t/g, "~A~B")).replace(/~B(.+?)~A/g, function(e, r) {
|
||||
for (var t = r, n = 4 - t.length % 4, s = 0; s < n; s++) t += " ";
|
||||
return t;
|
||||
})).replace(/~A/g, " ")).replace(/~B/g, "");
|
||||
}), a.subParser("encodeAmpsAndAngles", function(e) {
|
||||
return (e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&")).replace(/<(?![a-z\/?\$!])/gi, "<");
|
||||
}), a.subParser("encodeBackslashEscapes", function(e) {
|
||||
return (e = e.replace(/\\(\\)/g, a.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+-.!])/g, a.helper.escapeCharactersCallback);
|
||||
}), a.subParser("encodeCode", function(e) {
|
||||
return e = (e = (e = e.replace(/&/g, "&")).replace(/</g, "<")).replace(/>/g, ">"),
|
||||
a.helper.escapeCharacters(e, "*_{}[]\\", !1);
|
||||
}), a.subParser("encodeEmailAddress", function(e) {
|
||||
var r = [ function(e) {
|
||||
return "&#" + e.charCodeAt(0) + ";";
|
||||
}, function(e) {
|
||||
return "&#x" + e.charCodeAt(0).toString(16) + ";";
|
||||
}, function(e) {
|
||||
return e;
|
||||
} ];
|
||||
return (e = '<a href="' + (e = (e = "mailto:" + e).replace(/./g, function(e) {
|
||||
if ("@" === e) e = r[Math.floor(2 * Math.random())](e); else if (":" !== e) {
|
||||
var t = Math.random();
|
||||
e = t > .9 ? r[2](e) : t > .45 ? r[1](e) : r[0](e);
|
||||
}
|
||||
return e;
|
||||
})) + '">' + e + "</a>").replace(/">.+:/g, '">');
|
||||
}), a.subParser("escapeSpecialCharsWithinTagAttributes", function(e) {
|
||||
return e.replace(/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi, function(e) {
|
||||
var r = e.replace(/(.)<\/?code>(?=.)/g, "$1`");
|
||||
return a.helper.escapeCharacters(r, "\\`*_", !1);
|
||||
});
|
||||
}), a.subParser("githubCodeBlocks", function(e, r, t) {
|
||||
return r.ghCodeBlocks ? (e = t.converter._dispatch("githubCodeBlocks.before", e, r, t),
|
||||
e = (e = (e += "~0").replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function(e, n, s) {
|
||||
var o = r.omitExtraWLInCodeBlocks ? "" : "\n";
|
||||
return s = a.subParser("encodeCode")(s), s = "<pre><code" + (n ? ' class="' + n + " language-" + n + '"' : "") + ">" + (s = (s = (s = a.subParser("detab")(s)).replace(/^\n+/g, "")).replace(/\n+$/g, "")) + o + "</code></pre>",
|
||||
s = a.subParser("hashBlock")(s, r, t), "\n\n~G" + (t.ghCodeBlocks.push({
|
||||
text: e,
|
||||
codeblock: s
|
||||
}) - 1) + "G\n\n";
|
||||
})).replace(/~0/, ""), t.converter._dispatch("githubCodeBlocks.after", e, r, t)) : e;
|
||||
}), a.subParser("hashBlock", function(e, r, t) {
|
||||
return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (t.gHtmlBlocks.push(e) - 1) + "K\n\n";
|
||||
}), a.subParser("hashElement", function(e, r, t) {
|
||||
return function(e, r) {
|
||||
var n = r;
|
||||
return n = (n = (n = n.replace(/\n\n/g, "\n")).replace(/^\n/, "")).replace(/\n+$/g, ""),
|
||||
"\n\n~K" + (t.gHtmlBlocks.push(n) - 1) + "K\n\n";
|
||||
};
|
||||
}), a.subParser("hashHTMLBlocks", function(e, r, t) {
|
||||
for (var n = [ "pre", "div", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "table", "dl", "ol", "ul", "script", "noscript", "form", "fieldset", "iframe", "math", "style", "section", "header", "footer", "nav", "article", "aside", "address", "audio", "canvas", "figure", "hgroup", "output", "video", "p" ], s = 0; s < n.length; ++s) e = a.helper.replaceRecursiveRegExp(e, function(e, r, n, s) {
|
||||
var a = e;
|
||||
return -1 !== n.search(/\bmarkdown\b/) && (a = n + t.converter.makeHtml(r) + s),
|
||||
"\n\n~K" + (t.gHtmlBlocks.push(a) - 1) + "K\n\n";
|
||||
}, "^(?: |\\t){0,3}<" + n[s] + "\\b[^>]*>", "</" + n[s] + ">", "gim");
|
||||
return (e = (e = e.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, a.subParser("hashElement")(e, r, t))).replace(/(<!--[\s\S]*?-->)/g, a.subParser("hashElement")(e, r, t))).replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, a.subParser("hashElement")(e, r, t));
|
||||
}), a.subParser("hashHTMLSpans", function(e, r, t) {
|
||||
for (var n = a.helper.matchRecursiveRegExp(e, "<code\\b[^>]*>", "</code>", "gi"), s = 0; s < n.length; ++s) e = e.replace(n[s][0], "~L" + (t.gHtmlSpans.push(n[s][0]) - 1) + "L");
|
||||
return e;
|
||||
}), a.subParser("unhashHTMLSpans", function(e, r, t) {
|
||||
for (var n = 0; n < t.gHtmlSpans.length; ++n) e = e.replace("~L" + n + "L", t.gHtmlSpans[n]);
|
||||
return e;
|
||||
}), a.subParser("hashPreCodeTags", function(e, r, t) {
|
||||
return a.helper.replaceRecursiveRegExp(e, function(e, r, n, s) {
|
||||
var o = n + a.subParser("encodeCode")(r) + s;
|
||||
return "\n\n~G" + (t.ghCodeBlocks.push({
|
||||
text: e,
|
||||
codeblock: o
|
||||
}) - 1) + "G\n\n";
|
||||
}, "^(?: |\\t){0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^(?: |\\t){0,3}</code>\\s*</pre>", "gim");
|
||||
}), a.subParser("headers", function(e, r, t) {
|
||||
function n(e) {
|
||||
var r, n = e.replace(/[^\w]/g, "").toLowerCase();
|
||||
return t.hashLinkCounts[n] ? r = n + "-" + t.hashLinkCounts[n]++ : (r = n, t.hashLinkCounts[n] = 1),
|
||||
!0 === s && (s = "section"), a.helper.isString(s) ? s + r : r;
|
||||
}
|
||||
e = t.converter._dispatch("headers.before", e, r, t);
|
||||
var s = r.prefixHeaderId, o = isNaN(parseInt(r.headerLevelStart)) ? 1 : parseInt(r.headerLevelStart), i = r.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, l = r.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
|
||||
return e = (e = (e = e.replace(i, function(e, s) {
|
||||
var i = a.subParser("spanGamut")(s, r, t), l = r.noHeaderId ? "" : ' id="' + n(s) + '"', c = "<h" + o + l + ">" + i + "</h" + o + ">";
|
||||
return a.subParser("hashBlock")(c, r, t);
|
||||
})).replace(l, function(e, s) {
|
||||
var i = a.subParser("spanGamut")(s, r, t), l = r.noHeaderId ? "" : ' id="' + n(s) + '"', c = o + 1, u = "<h" + c + l + ">" + i + "</h" + c + ">";
|
||||
return a.subParser("hashBlock")(u, r, t);
|
||||
})).replace(/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm, function(e, s, i) {
|
||||
var l = a.subParser("spanGamut")(i, r, t), c = r.noHeaderId ? "" : ' id="' + n(i) + '"', u = o - 1 + s.length, p = "<h" + u + c + ">" + l + "</h" + u + ">";
|
||||
return a.subParser("hashBlock")(p, r, t);
|
||||
}), t.converter._dispatch("headers.after", e, r, t);
|
||||
}), a.subParser("images", function(e, r, t) {
|
||||
function n(e, r, n, s, o, i, l, c) {
|
||||
var u = t.gUrls, p = t.gTitles, h = t.gDimensions;
|
||||
if (n = n.toLowerCase(), c || (c = ""), "" === s || null === s) {
|
||||
if ("" !== n && null !== n || (n = r.toLowerCase().replace(/ ?\n/g, " ")), s = "#" + n,
|
||||
a.helper.isUndefined(u[n])) return e;
|
||||
s = u[n], a.helper.isUndefined(p[n]) || (c = p[n]), a.helper.isUndefined(h[n]) || (o = h[n].width,
|
||||
i = h[n].height);
|
||||
}
|
||||
r = r.replace(/"/g, """), r = a.helper.escapeCharacters(r, "*_", !1);
|
||||
var d = '<img src="' + (s = a.helper.escapeCharacters(s, "*_", !1)) + '" alt="' + r + '"';
|
||||
return c && (c = c.replace(/"/g, """), d += ' title="' + (c = a.helper.escapeCharacters(c, "*_", !1)) + '"'),
|
||||
o && i && (d += ' width="' + (o = "*" === o ? "auto" : o) + '"', d += ' height="' + (i = "*" === i ? "auto" : i) + '"'),
|
||||
d + " />";
|
||||
}
|
||||
return e = (e = (e = t.converter._dispatch("images.before", e, r, t)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[(.*?)]()()()()()/g, n)).replace(/!\[(.*?)]\s?\([ \t]*()<?(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(['"])(.*?)\6[ \t]*)?\)/g, n),
|
||||
t.converter._dispatch("images.after", e, r, t);
|
||||
}), a.subParser("italicsAndBold", function(e, r, t) {
|
||||
return e = t.converter._dispatch("italicsAndBold.before", e, r, t), e = r.literalMidWordUnderscores ? (e = (e = (e = e.replace(/(^|\s|>|\b)__(?=\S)([\s\S]+?)__(?=\b|<|\s|$)/gm, "$1<strong>$2</strong>")).replace(/(^|\s|>|\b)_(?=\S)([\s\S]+?)_(?=\b|<|\s|$)/gm, "$1<em>$2</em>")).replace(/(\*\*)(?=\S)([^\r]*?\S[*]*)\1/g, "<strong>$2</strong>")).replace(/(\*)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>") : (e = e.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, "<strong>$2</strong>")).replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>"),
|
||||
t.converter._dispatch("italicsAndBold.after", e, r, t);
|
||||
}), a.subParser("lists", function(e, r, t) {
|
||||
function n(e, n) {
|
||||
t.gListLevel++, e = e.replace(/\n{2,}$/, "\n");
|
||||
var s = /\n[ \t]*\n(?!~0)/.test(e += "~0");
|
||||
return e = (e = e.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm, function(e, n, o, i, l, c, u) {
|
||||
u = u && "" !== u.trim();
|
||||
var p = a.subParser("outdent")(l, r, t), h = "";
|
||||
return c && r.tasklists && (h = ' class="task-list-item" style="list-style-type: none;"',
|
||||
p = p.replace(/^[ \t]*\[(x|X| )?]/m, function() {
|
||||
var e = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
|
||||
return u && (e += " checked"), e + ">";
|
||||
})), n || p.search(/\n{2,}/) > -1 ? (p = a.subParser("githubCodeBlocks")(p, r, t),
|
||||
p = a.subParser("blockGamut")(p, r, t)) : (p = (p = a.subParser("lists")(p, r, t)).replace(/\n$/, ""),
|
||||
p = s ? a.subParser("paragraphs")(p, r, t) : a.subParser("spanGamut")(p, r, t)),
|
||||
"\n<li" + h + ">" + p + "</li>\n";
|
||||
})).replace(/~0/g, ""), t.gListLevel--, n && (e = e.replace(/\s+$/, "")), e;
|
||||
}
|
||||
function s(e, r, t) {
|
||||
var s = "ul" === r ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm, a = [], o = "";
|
||||
if (-1 !== e.search(s)) {
|
||||
!function e(a) {
|
||||
var i = a.search(s);
|
||||
-1 !== i ? (o += "\n\n<" + r + ">" + n(a.slice(0, i), !!t) + "</" + r + ">\n\n",
|
||||
s = "ul" == (r = "ul" === r ? "ol" : "ul") ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm,
|
||||
e(a.slice(i))) : o += "\n\n<" + r + ">" + n(a, !!t) + "</" + r + ">\n\n";
|
||||
}(e);
|
||||
for (var i = 0; i < a.length; ++i) ;
|
||||
} else o = "\n\n<" + r + ">" + n(e, !!t) + "</" + r + ">\n\n";
|
||||
return o;
|
||||
}
|
||||
e = t.converter._dispatch("lists.before", e, r, t), e += "~0";
|
||||
var o = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
|
||||
return t.gListLevel ? e = e.replace(o, function(e, r, t) {
|
||||
return s(r, t.search(/[*+-]/g) > -1 ? "ul" : "ol", !0);
|
||||
}) : (o = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
|
||||
e = e.replace(o, function(e, r, t, n) {
|
||||
return s(t, n.search(/[*+-]/g) > -1 ? "ul" : "ol");
|
||||
})), e = e.replace(/~0/, ""), t.converter._dispatch("lists.after", e, r, t);
|
||||
}), a.subParser("outdent", function(e) {
|
||||
return (e = e.replace(/^(\t|[ ]{1,4})/gm, "~0")).replace(/~0/g, "");
|
||||
}), a.subParser("paragraphs", function(e, r, t) {
|
||||
for (var n = (e = (e = (e = t.converter._dispatch("paragraphs.before", e, r, t)).replace(/^\n+/g, "")).replace(/\n+$/g, "")).split(/\n{2,}/g), s = [], o = n.length, i = 0; i < o; i++) {
|
||||
var l = n[i];
|
||||
l.search(/~(K|G)(\d+)\1/g) >= 0 || (l = (l = a.subParser("spanGamut")(l, r, t)).replace(/^([ \t]*)/g, "<p>"),
|
||||
l += "</p>"), s.push(l);
|
||||
}
|
||||
for (o = s.length, i = 0; i < o; i++) {
|
||||
for (var c = "", u = s[i], p = !1; u.search(/~(K|G)(\d+)\1/) >= 0; ) {
|
||||
var h = RegExp.$1, d = RegExp.$2;
|
||||
c = (c = "K" === h ? t.gHtmlBlocks[d] : p ? a.subParser("encodeCode")(t.ghCodeBlocks[d].text) : t.ghCodeBlocks[d].codeblock).replace(/\$/g, "$$$$"),
|
||||
u = u.replace(/(\n\n)?~(K|G)\d+\2(\n\n)?/, c), /^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u) && (p = !0);
|
||||
}
|
||||
s[i] = u;
|
||||
}
|
||||
return e = (e = (e = s.join("\n\n")).replace(/^\n+/g, "")).replace(/\n+$/g, ""),
|
||||
t.converter._dispatch("paragraphs.after", e, r, t);
|
||||
}), a.subParser("runExtension", function(e, r, t, n) {
|
||||
if (e.filter) r = e.filter(r, n.converter, t); else if (e.regex) {
|
||||
var s = e.regex;
|
||||
!s instanceof RegExp && (s = new RegExp(s, "g")), r = r.replace(s, e.replace);
|
||||
}
|
||||
return r;
|
||||
}), a.subParser("spanGamut", function(e, r, t) {
|
||||
return e = t.converter._dispatch("spanGamut.before", e, r, t), e = a.subParser("codeSpans")(e, r, t),
|
||||
e = a.subParser("escapeSpecialCharsWithinTagAttributes")(e, r, t), e = a.subParser("encodeBackslashEscapes")(e, r, t),
|
||||
e = a.subParser("images")(e, r, t), e = a.subParser("anchors")(e, r, t), e = a.subParser("autoLinks")(e, r, t),
|
||||
e = a.subParser("encodeAmpsAndAngles")(e, r, t), e = a.subParser("italicsAndBold")(e, r, t),
|
||||
e = (e = a.subParser("strikethrough")(e, r, t)).replace(/ +\n/g, " <br />\n"),
|
||||
t.converter._dispatch("spanGamut.after", e, r, t);
|
||||
}), a.subParser("strikethrough", function(e, r, t) {
|
||||
return r.strikethrough && (e = (e = t.converter._dispatch("strikethrough.before", e, r, t)).replace(/(?:~T){2}([\s\S]+?)(?:~T){2}/g, "<del>$1</del>"),
|
||||
e = t.converter._dispatch("strikethrough.after", e, r, t)), e;
|
||||
}), a.subParser("stripBlankLines", function(e) {
|
||||
return e.replace(/^[ \t]+$/gm, "");
|
||||
}), a.subParser("stripLinkDefinitions", function(e, r, t) {
|
||||
return (e = (e += "~0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=~0))/gm, function(e, n, s, o, i, l, c) {
|
||||
return n = n.toLowerCase(), t.gUrls[n] = a.subParser("encodeAmpsAndAngles")(s),
|
||||
l ? l + c : (c && (t.gTitles[n] = c.replace(/"|'/g, """)), r.parseImgDimensions && o && i && (t.gDimensions[n] = {
|
||||
width: o,
|
||||
height: i
|
||||
}), "");
|
||||
})).replace(/~0/, "");
|
||||
}), a.subParser("tables", function(e, r, t) {
|
||||
function n(e) {
|
||||
return /^:[ \t]*--*$/.test(e) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(e) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(e) ? ' style="text-align:center;"' : "";
|
||||
}
|
||||
function s(e, n) {
|
||||
var s = "";
|
||||
return e = e.trim(), r.tableHeaderId && (s = ' id="' + e.replace(/ /g, "_").toLowerCase() + '"'),
|
||||
"<th" + s + n + ">" + (e = a.subParser("spanGamut")(e, r, t)) + "</th>\n";
|
||||
}
|
||||
function o(e, n) {
|
||||
return "<td" + n + ">" + a.subParser("spanGamut")(e, r, t) + "</td>\n";
|
||||
}
|
||||
if (!r.tables) return e;
|
||||
return e = (e = t.converter._dispatch("tables.before", e, r, t)).replace(/^[ \t]{0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm, function(e) {
|
||||
var r, t = e.split("\n");
|
||||
for (r = 0; r < t.length; ++r) /^[ \t]{0,3}\|/.test(t[r]) && (t[r] = t[r].replace(/^[ \t]{0,3}\|/, "")),
|
||||
/\|[ \t]*$/.test(t[r]) && (t[r] = t[r].replace(/\|[ \t]*$/, ""));
|
||||
var i = t[0].split("|").map(function(e) {
|
||||
return e.trim();
|
||||
}), l = t[1].split("|").map(function(e) {
|
||||
return e.trim();
|
||||
}), c = [], u = [], p = [], h = [];
|
||||
for (t.shift(), t.shift(), r = 0; r < t.length; ++r) "" !== t[r].trim() && c.push(t[r].split("|").map(function(e) {
|
||||
return e.trim();
|
||||
}));
|
||||
if (i.length < l.length) return e;
|
||||
for (r = 0; r < l.length; ++r) p.push(n(l[r]));
|
||||
for (r = 0; r < i.length; ++r) a.helper.isUndefined(p[r]) && (p[r] = ""), u.push(s(i[r], p[r]));
|
||||
for (r = 0; r < c.length; ++r) {
|
||||
for (var d = [], f = 0; f < u.length; ++f) a.helper.isUndefined(c[r][f]), d.push(o(c[r][f], p[f]));
|
||||
h.push(d);
|
||||
}
|
||||
return function(e, r) {
|
||||
for (var t = "<table>\n<thead>\n<tr>\n", n = e.length, s = 0; s < n; ++s) t += e[s];
|
||||
for (t += "</tr>\n</thead>\n<tbody>\n", s = 0; s < r.length; ++s) {
|
||||
t += "<tr>\n";
|
||||
for (var a = 0; a < n; ++a) t += r[s][a];
|
||||
t += "</tr>\n";
|
||||
}
|
||||
return t + "</tbody>\n</table>\n";
|
||||
}(u, h);
|
||||
}), t.converter._dispatch("tables.after", e, r, t);
|
||||
}), a.subParser("unescapeSpecialChars", function(e) {
|
||||
return e.replace(/~E(\d+)E/g, function(e, r) {
|
||||
var t = parseInt(r);
|
||||
return String.fromCharCode(t);
|
||||
});
|
||||
}), module.exports = a;
|
||||
18
wx05cb767e6530b48f/wxParse/wxDiscode.js
Normal file
18
wx05cb767e6530b48f/wxParse/wxDiscode.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
strDiscode: function(e) {
|
||||
return function(e) {
|
||||
return (e = (e = e.replace(/\r\n/g, "")).replace(/\n/g, "")).replace(/code/g, "wxxxcode-style");
|
||||
}(e = function(e) {
|
||||
return (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace(/Œ/g, "Œ")).replace(/œ/g, "œ")).replace(/Š/g, "Š")).replace(/š/g, "š")).replace(/Ÿ/g, "Ÿ")).replace(/ƒ/g, "ƒ")).replace(/ˆ/g, "ˆ")).replace(/˜/g, "˜")).replace(/ /g, "")).replace(/ /g, "")).replace(/ /g, "")).replace(/‌/g, "")).replace(/‍/g, "")).replace(/‎/g, "")).replace(/‏/g, "")).replace(/–/g, "–")).replace(/—/g, "—")).replace(/‘/g, "‘")).replace(/’/g, "’")).replace(/‚/g, "‚")).replace(/“/g, "“")).replace(/”/g, "”")).replace(/„/g, "„")).replace(/†/g, "†")).replace(/‡/g, "‡")).replace(/•/g, "•")).replace(/…/g, "…")).replace(/‰/g, "‰")).replace(/′/g, "′")).replace(/″/g, "″")).replace(/‹/g, "‹")).replace(/›/g, "›")).replace(/‾/g, "‾")).replace(/€/g, "€")).replace(/™/g, "™")).replace(/←/g, "←")).replace(/↑/g, "↑")).replace(/→/g, "→")).replace(/↓/g, "↓")).replace(/↔/g, "↔")).replace(/↵/g, "↵")).replace(/⌈/g, "⌈")).replace(/⌉/g, "⌉")).replace(/⌊/g, "⌊")).replace(/⌋/g, "⌋")).replace(/◊/g, "◊")).replace(/♠/g, "♠")).replace(/♣/g, "♣")).replace(/♥/g, "♥")).replace(/♦/g, "♦");
|
||||
}(e = function(e) {
|
||||
return (e = (e = (e = (e = e.replace(/ /g, " ")).replace(/"/g, "'")).replace(/&/g, "&")).replace(/</g, "<")).replace(/>/g, ">");
|
||||
}(e = function(e) {
|
||||
return (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace(/Α/g, "Α")).replace(/Β/g, "Β")).replace(/Γ/g, "Γ")).replace(/Δ/g, "Δ")).replace(/Ε/g, "Ε")).replace(/Ζ/g, "Ζ")).replace(/Η/g, "Η")).replace(/Θ/g, "Θ")).replace(/Ι/g, "Ι")).replace(/Κ/g, "Κ")).replace(/Λ/g, "Λ")).replace(/Μ/g, "Μ")).replace(/Ν/g, "Ν")).replace(/Ξ/g, "Ν")).replace(/Ο/g, "Ο")).replace(/Π/g, "Π")).replace(/Ρ/g, "Ρ")).replace(/Σ/g, "Σ")).replace(/Τ/g, "Τ")).replace(/Υ/g, "Υ")).replace(/Φ/g, "Φ")).replace(/Χ/g, "Χ")).replace(/Ψ/g, "Ψ")).replace(/Ω/g, "Ω")).replace(/α/g, "α")).replace(/β/g, "β")).replace(/γ/g, "γ")).replace(/δ/g, "δ")).replace(/ε/g, "ε")).replace(/ζ/g, "ζ")).replace(/η/g, "η")).replace(/θ/g, "θ")).replace(/ι/g, "ι")).replace(/κ/g, "κ")).replace(/λ/g, "λ")).replace(/μ/g, "μ")).replace(/ν/g, "ν")).replace(/ξ/g, "ξ")).replace(/ο/g, "ο")).replace(/π/g, "π")).replace(/ρ/g, "ρ")).replace(/ς/g, "ς")).replace(/σ/g, "σ")).replace(/τ/g, "τ")).replace(/υ/g, "υ")).replace(/φ/g, "φ")).replace(/χ/g, "χ")).replace(/ψ/g, "ψ")).replace(/ω/g, "ω")).replace(/ϑ/g, "ϑ")).replace(/ϒ/g, "ϒ")).replace(/ϖ/g, "ϖ")).replace(/·/g, "·");
|
||||
}(e = function(e) {
|
||||
return (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace(/∀/g, "∀")).replace(/∂/g, "∂")).replace(/&exists;/g, "∃")).replace(/∅/g, "∅")).replace(/∇/g, "∇")).replace(/∈/g, "∈")).replace(/∉/g, "∉")).replace(/∋/g, "∋")).replace(/∏/g, "∏")).replace(/∑/g, "∑")).replace(/−/g, "−")).replace(/∗/g, "∗")).replace(/√/g, "√")).replace(/∝/g, "∝")).replace(/∞/g, "∞")).replace(/∠/g, "∠")).replace(/∧/g, "∧")).replace(/∨/g, "∨")).replace(/∩/g, "∩")).replace(/∩/g, "∪")).replace(/∫/g, "∫")).replace(/∴/g, "∴")).replace(/∼/g, "∼")).replace(/≅/g, "≅")).replace(/≈/g, "≈")).replace(/≠/g, "≠")).replace(/≤/g, "≤")).replace(/≥/g, "≥")).replace(/⊂/g, "⊂")).replace(/⊃/g, "⊃")).replace(/⊄/g, "⊄")).replace(/⊆/g, "⊆")).replace(/⊇/g, "⊇")).replace(/⊕/g, "⊕")).replace(/⊗/g, "⊗")).replace(/⊥/g, "⊥")).replace(/⋅/g, "⋅");
|
||||
}(e)))));
|
||||
},
|
||||
urlToHttpUrl: function(e, a) {
|
||||
return new RegExp("^//").test(e) && (e = a + ":" + e), e;
|
||||
}
|
||||
};
|
||||
43
wx05cb767e6530b48f/wxParse/wxParse.js
Normal file
43
wx05cb767e6530b48f/wxParse/wxParse.js
Normal file
@@ -0,0 +1,43 @@
|
||||
function e(e) {
|
||||
return e && e.__esModule ? e : {
|
||||
default: e
|
||||
};
|
||||
}
|
||||
|
||||
function a(e) {
|
||||
var a = e.target.dataset.src, t = e.target.dataset.from;
|
||||
void 0 !== t && t.length > 0 && wx.previewImage({
|
||||
current: a,
|
||||
urls: this.data[t].imageUrls
|
||||
});
|
||||
}
|
||||
|
||||
function t(e) {
|
||||
return !1;
|
||||
}
|
||||
|
||||
var r = e(require("./showdown.js")), i = e(require("./html2json.js"));
|
||||
|
||||
module.exports = {
|
||||
wxParse: function() {
|
||||
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "wxParseData", n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "html", s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '<div class="color:red;">数据不能为空</div>', o = arguments[3], d = arguments[4], l = o, m = {};
|
||||
if ("html" == n) m = i.default.html2json(s, e); else if ("md" == n || "markdown" == n) {
|
||||
var u = new r.default.Converter().makeHtml(s);
|
||||
m = i.default.html2json(u, e);
|
||||
}
|
||||
m.view = {}, m.view.imagePadding = 0, void 0 !== d && (m.view.imagePadding = d);
|
||||
var v = {};
|
||||
v[e] = m, l.setData(v), l.wxParseImgLoad = t, l.wxParseImgTap = a;
|
||||
},
|
||||
wxParseTemArray: function(e, a, t, r) {
|
||||
for (var i = [], n = r.data, s = null, o = 0; o < t; o++) {
|
||||
var d = n[a + o].nodes;
|
||||
i.push(d);
|
||||
}
|
||||
e = e || "wxParseTemArray", (s = JSON.parse('{"' + e + '":""}'))[e] = i, r.setData(s);
|
||||
},
|
||||
emojisInit: function() {
|
||||
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "/wxParse/emojis/", t = arguments[2];
|
||||
i.default.emojisInit(e, a, t);
|
||||
}
|
||||
};
|
||||
370
wx05cb767e6530b48f/wxParse/wxParse.wxml
Normal file
370
wx05cb767e6530b48f/wxParse/wxParse.wxml
Normal file
@@ -0,0 +1,370 @@
|
||||
<template name="wxParseVideo">
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}">
|
||||
<video class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{item.attr.src}}"></video>
|
||||
</view>
|
||||
</template>
|
||||
<template name="wxParseImg">
|
||||
<image bindload="wxParseImgLoad" bindtap="wxParseImgTap" class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-idx="{{item.imgIndex}}" data-src="{{item.attr.src}}" mode="widthFix" src="{{item.attr.src}}" style="width:{{item.width}}px;"></image>
|
||||
</template>
|
||||
<template name="WxEmojiView">
|
||||
<view class="WxEmojiView wxParse-inline" style="{{item.styleStr}}">
|
||||
<block wx:for="{{item.textArray}}" wx:key="this">
|
||||
<block wx:if="{{item.node=='text'}}">{{item.text}}</block>
|
||||
<image class="wxEmoji" src="{{item.baseSrc}}{{item.text}}" wx:elif="{{item.node=='element'}}"></image>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
<template name="wxParse">
|
||||
<template is="wxParse0" data="{{item:item}}" wx:for="{{wxParseData}}" wx:key="this"></template>
|
||||
</template>
|
||||
<template name="wxParse0">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse1" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse1" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-c="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse1" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='table'}}">
|
||||
<template is="wxParse1" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse1" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse1" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse1">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse2" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse2" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse2" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse2" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse2" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse2">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse3" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse3" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse3" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse3" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse3" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse3">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse4" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse4" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse4" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse4" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse4" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse4">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse5" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse5" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse5" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse5" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse5" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse5">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse6" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse6" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse6" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse6" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse6" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse6">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse7" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse7" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse7" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse7" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse7" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse7">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse8" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse8" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse8" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse8" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse8" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse8">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse9" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse9" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse9" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse9" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse9" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse9">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse10" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse10" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse10" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse10" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse10" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse10">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse11" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse11" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse11" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse11" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse11" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
<template name="wxParse11">
|
||||
<block wx:if="{{item.node=='element'}}">
|
||||
<button size="mini" type="default" wx:if="{{item.tag=='button'}}">
|
||||
<template is="wxParse12" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</button>
|
||||
<view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}" wx:elif="{{item.tag=='li'}}">
|
||||
<view class="{{item.classStr}} wxParse-li-inner">
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<view class="{{item.classStr}} wxParse-li-circle"></view>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-li-text">
|
||||
<template is="wxParse12" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template is="wxParseVideo" data="{{item:item}}" wx:elif="{{item.tag=='video'}}"></template>
|
||||
<template is="wxParseImg" data="{{item:item}}" wx:elif="{{item.tag=='img'}}"></template>
|
||||
<view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}" wx:elif="{{item.tag=='a'}}">
|
||||
<template is="wxParse12" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}" wx:elif="{{item.tagType=='block'}}">
|
||||
<template is="wxParse12" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
<view class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}" wx:else>
|
||||
<template is="wxParse12" data="{{item:item}}" wx:for="{{item.nodes}}" wx:key="this"></template>
|
||||
</view>
|
||||
</block>
|
||||
<template is="WxEmojiView" data="{{item:item}}" wx:elif="{{item.node=='text'}}"></template>
|
||||
</template>
|
||||
241
wx05cb767e6530b48f/wxParse/wxParse.wxss
Normal file
241
wx05cb767e6530b48f/wxParse/wxParse.wxss
Normal file
@@ -0,0 +1,241 @@
|
||||
.wxParse {
|
||||
color: #666;
|
||||
font-family: Helvetica,sans-serif;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.8;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
view {
|
||||
overflow: auto;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.wxParse-inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wxParse-div,.wxParse-inline {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wxParse-h1 {
|
||||
font-size: 2em;
|
||||
margin: .67em 0;
|
||||
}
|
||||
|
||||
.wxParse-h2 {
|
||||
font-size: 1.5em;
|
||||
margin: .75em 0;
|
||||
}
|
||||
|
||||
.wxParse-h3 {
|
||||
font-size: 1.17em;
|
||||
margin: .83em 0;
|
||||
}
|
||||
|
||||
.wxParse-h4 {
|
||||
margin: 1.12em 0;
|
||||
}
|
||||
|
||||
.wxParse-h5 {
|
||||
font-size: .83em;
|
||||
margin: 1.5em 0;
|
||||
}
|
||||
|
||||
.wxParse-h6 {
|
||||
font-size: .75em;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
.wxParse-h1 {
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
margin-bottom: .9em;
|
||||
}
|
||||
|
||||
.wxParse-h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.wxParse-h2,.wxParse-h3 {
|
||||
font-weight: 400;
|
||||
margin-bottom: .34em;
|
||||
}
|
||||
|
||||
.wxParse-h3 {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.wxParse-h4 {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin-bottom: .24em;
|
||||
}
|
||||
|
||||
.wxParse-h5 {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
margin-bottom: .14em;
|
||||
}
|
||||
|
||||
.wxParse-h6 {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
margin-bottom: .04em;
|
||||
}
|
||||
|
||||
.wxParse-b,.wxParse-h1,.wxParse-h2,.wxParse-h3,.wxParse-h4,.wxParse-h5,.wxParse-h6,.wxParse-strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.wxParse-address,.wxParse-cite,.wxParse-em,.wxParse-i,.wxParse-var {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.wxParse-code,.wxParse-kbd,.wxParse-pre,.wxParse-samp,.wxParse-tt {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.wxParse-pre {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.wxParse-big {
|
||||
font-size: 1.17em;
|
||||
}
|
||||
|
||||
.wxParse-small,.wxParse-sub,.wxParse-sup {
|
||||
font-size: .83em;
|
||||
}
|
||||
|
||||
.wxParse-sub {
|
||||
vertical-align: sub;
|
||||
}
|
||||
|
||||
.wxParse-sup {
|
||||
vertical-align: super;
|
||||
}
|
||||
|
||||
.wxParse-del,.wxParse-s,.wxParse-strike {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.wxParse-s,.wxParse-strong {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wxParse-a {
|
||||
color: #00bfff;
|
||||
overflow: auto;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.wxParse-video {
|
||||
margin: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wxParse-video-video {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wxParse-img {
|
||||
background-color: #efefef;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wxParse-blockquote {
|
||||
background: #f5f5f5;
|
||||
border-left: 3px solid #dbdbdb;
|
||||
font-family: Courier,Calibri,宋体;
|
||||
margin: 0;
|
||||
padding: 10px 0 10px 5px;
|
||||
}
|
||||
|
||||
.wxParse-code,.wxParse-wxxxcode-style {
|
||||
background: #f5f5f5;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wxParse-ul {
|
||||
margin: 20rpx 10rpx;
|
||||
}
|
||||
|
||||
.wxParse-li,.wxParse-li-inner {
|
||||
align-items: baseline;
|
||||
display: flex;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.wxParse-li-text {
|
||||
align-items: center;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.wxParse-li-circle {
|
||||
background-color: #333;
|
||||
display: inline-flex;
|
||||
height: 5px;
|
||||
margin-right: 5px;
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
.wxParse-li-square {
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
.wxParse-li-ring,.wxParse-li-square {
|
||||
display: inline-flex;
|
||||
height: 10rpx;
|
||||
margin-right: 5px;
|
||||
width: 10rpx;
|
||||
}
|
||||
|
||||
.wxParse-li-ring {
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #333;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.wxParse-u {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.wxParse-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.WxEmojiView {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wxEmoji {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.wxParse-tr {
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
border-right: 1px solid #e0e0e0;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.wxParse-td,.wxParse-th {
|
||||
border-left: 1px solid #e0e0e0;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
padding: 5px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.wxParse-td:last {
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.wxParse-th {
|
||||
background: #f0f0f0;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
Reference in New Issue
Block a user