mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Use utils.stitchElement in WikiTextParseTree.compileElementHtml
This commit is contained in:
parent
33ad4461db
commit
32c8e69949
@ -166,21 +166,9 @@ WikiTextParseTree.prototype.compileMacroCall = function(output,type,node) {
|
|||||||
|
|
||||||
WikiTextParseTree.prototype.compileElementHtml = function(output,element,options) {
|
WikiTextParseTree.prototype.compileElementHtml = function(output,element,options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var tagBits = [element.type];
|
this.pushString(output,utils.stitchElement(element.type,element.attributes,{
|
||||||
if(element.attributes) {
|
selfClosing: options.selfClosing
|
||||||
for(var a in element.attributes) {
|
}));
|
||||||
var r = element.attributes[a];
|
|
||||||
if(a === "style") {
|
|
||||||
var s = [];
|
|
||||||
for(var t in r) {
|
|
||||||
s.push(t + ":" + r[t] + ";");
|
|
||||||
}
|
|
||||||
r = s.join("");
|
|
||||||
}
|
|
||||||
tagBits.push(a + "=\"" + utils.htmlEncode(r) + "\"");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.pushString(output,"<" + tagBits.join(" ") + (options.selfClosing ? " /" : "") + ">");
|
|
||||||
if(!options.selfClosing) {
|
if(!options.selfClosing) {
|
||||||
if(element.children) {
|
if(element.children) {
|
||||||
this.compileSubTreeHtml(output,element.children);
|
this.compileSubTreeHtml(output,element.children);
|
||||||
|
Loading…
Reference in New Issue
Block a user