mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Added proper HTML rendering of style attributes
This commit is contained in:
parent
ad26dd6be3
commit
e1e510cea2
@ -60,7 +60,15 @@ WikiTextParser.prototype.renderAsHtml = function(store,title) {
|
|||||||
var tagBits = [element.type];
|
var tagBits = [element.type];
|
||||||
if(element.attributes) {
|
if(element.attributes) {
|
||||||
for(var a in element.attributes) {
|
for(var a in element.attributes) {
|
||||||
tagBits.push(a + "=\"" + utils.htmlEncode(element.attributes[a]) + "\"");
|
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) + "\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
output.push("<" + tagBits.join(" ") + (selfClosing ? " /" : "") + ">");
|
output.push("<" + tagBits.join(" ") + (selfClosing ? " /" : "") + ">");
|
||||||
|
Loading…
Reference in New Issue
Block a user