mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 07:32:59 +00:00 
			
		
		
		
	Add parse tree helper for styling elements
This commit is contained in:
		| @@ -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 + ";"; | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| })(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston