mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-06 22:04:19 +00:00
Add parse tree helper for styling elements
This commit is contained in:
parent
36290c14fa
commit
5c2f698842
@ -29,4 +29,14 @@ exports.addClassToParseTreeNode = function(node,classString) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.addStyleToParseTreeNode = function(node,name,value) {
|
||||||
|
if(node.type === "element") {
|
||||||
|
node.attributes = node.attributes || {};
|
||||||
|
node.attributes["style"] = node.attributes["style"] || {type: "string", value: ""};
|
||||||
|
if(node.attributes["style"].type === "string") {
|
||||||
|
node.attributes["style"].value += name + ":" + value + ";";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user