mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-30 23:23:02 +00:00 
			
		
		
		
	Change macro attributes to not wikify their content
One consequence of wikifying macro attributes before use was that we couldn’t have tiddler titles with wikitext syntax in, which was definitely a problem.
This commit is contained in:
		| @@ -214,8 +214,7 @@ Widget.prototype.computeAttributes = function() { | |||||||
| 		if(attribute.type === "indirect") { | 		if(attribute.type === "indirect") { | ||||||
| 			value = self.wiki.getTextReference(attribute.textReference,"",self.getVariable("currentTiddler")); | 			value = self.wiki.getTextReference(attribute.textReference,"",self.getVariable("currentTiddler")); | ||||||
| 		} else if(attribute.type === "macro") { | 		} else if(attribute.type === "macro") { | ||||||
| 			var text = self.getVariable(attribute.value.name,{params: attribute.value.params}); | 			value = self.getVariable(attribute.value.name,{params: attribute.value.params}); | ||||||
| 			value = self.wiki.renderText("text/plain","text/vnd.tiddlywiki",text,{parentWidget: self}); |  | ||||||
| 		} else { // String attribute | 		} else { // String attribute | ||||||
| 			value = attribute.value; | 			value = attribute.value; | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ describe("WikiText tests", function() { | |||||||
| 		expect(wiki.renderTiddler("text/html","TiddlerThree")).toBe("<p>The speed of sound</p><p>The light of speed</p>"); | 		expect(wiki.renderTiddler("text/html","TiddlerThree")).toBe("<p>The speed of sound</p><p>The light of speed</p>"); | ||||||
| 	}); | 	}); | ||||||
| 	it("should support attributes specified as macro invocations", function() { | 	it("should support attributes specified as macro invocations", function() { | ||||||
| 		expect(wiki.renderTiddler("text/html","TiddlerFour")).toBe("<p><a class=' tw-tiddlylink tw-tiddlylink-missing' href='#This%20is%20my%20amazingly%20groovy%20macro!'>This is a link</a></p>"); | 		expect(wiki.renderTiddler("text/html","TiddlerFour")).toBe("<p><a class=' tw-tiddlylink tw-tiddlylink-missing' href='#This%20is%20my%20''amazingly''%20groovy%20macro!'>This is a link</a></p>"); | ||||||
| 	}); | 	}); | ||||||
|  |  | ||||||
| }); | }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene