diff util/xtemplate.lua @ 13525:0f7e7311eebf

util.xtemplate: Use same argument order in filters even without 'args' This removes the different argument order used between '{x|foo}' and '{x|foo(y)}' because the differing order was awkward and confusing. This util does not seem to be widely used so should not be problematic to change this part. The only known use is in mod_pubsub, which does not use the filter function feature.
author Kim Alvefur <zash@zash.se>
date Wed, 16 Oct 2024 16:15:05 +0200
parents 05f028de4c45
children
line wrap: on
line diff
--- a/util/xtemplate.lua	Sun Oct 13 13:03:08 2024 +0200
+++ b/util/xtemplate.lua	Wed Oct 16 16:15:05 2024 +0200
@@ -70,11 +70,7 @@
 				end
 			elseif filters and filters[func] then
 				local f = filters[func];
-				if args == nil then
-					value, is_escaped = f(value, tmpl);
-				else
-					value, is_escaped = f(args, value, tmpl);
-				end
+				value, is_escaped = f(value, args, tmpl);
 			else
 				error("No such filter function: " .. func);
 			end