mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-29 06:37:39 +00:00 
			
		
		
		
	Update transclude parser rule to use the tiddler macro for single tiddlers
This commit is contained in:
		| @@ -34,21 +34,23 @@ exports.parse = function(match,isBlock) { | |||||||
| 	match = regExp.exec(this.source); | 	match = regExp.exec(this.source); | ||||||
| 	if(match && match.index === this.pos) { | 	if(match && match.index === this.pos) { | ||||||
| 		this.pos = match.index + match[0].length; | 		this.pos = match.index + match[0].length; | ||||||
| 		var params = {}; | 		var macro, params = {}; | ||||||
| 		// Check if it is a single tiddler | 		// Check if it is a single tiddler | ||||||
| 		if(match[1]) { | 		if(match[1]) { | ||||||
| 			params.title = match[1]; | 			macro = "tiddler"; | ||||||
|  | 			params.target = match[1]; | ||||||
| 		} else { | 		} else { | ||||||
| 			// Else it is a filter | 			// Else it is a filter | ||||||
|  | 			macro = "transclude"; | ||||||
| 			params.filter = match[2]; | 			params.filter = match[2]; | ||||||
| 		} | 		} | ||||||
| 		if(match[3]) { | 		if(match[3]) { | ||||||
| 			params.templateTitle = match[3]; | 			params.template = match[3]; | ||||||
| 		} | 		} | ||||||
| 		if(match[4]) { | 		if(match[4]) { | ||||||
| 			params.templateText = match[4]; | 			params.templateText = match[4]; | ||||||
| 		} | 		} | ||||||
| 		return [$tw.Tree.Macro("transclude",{ | 		return [$tw.Tree.Macro(macro,{ | ||||||
| 			srcParams: params, | 			srcParams: params, | ||||||
| 			wiki: this.wiki | 			wiki: this.wiki | ||||||
| 		})]; | 		})]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston