From 1f45b635448b2b2bb89591999dbe1764ee06d102 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Mon, 25 Jan 2021 20:58:11 +0100
Subject: util.interpolation: Fix combination of filters and fallback values
 #1623

---
 util/interpolation.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'util')

diff --git a/util/interpolation.lua b/util/interpolation.lua
index e0ccf47b..3e1f8c4a 100644
--- a/util/interpolation.lua
+++ b/util/interpolation.lua
@@ -43,11 +43,11 @@ local function new_render(pat, escape, funcs)
 				end
 			end
 			if funcs then
-				while value ~= nil and opt == '|' do
+				while opt == '|' do
 					local f;
 					f, raw, opt, e = s_match(block, "^([%a_][%w_.]*)(!?)(%p?)()", e);
 					f = funcs[f];
-					if f then value = f(value); end
+					if value ~= nil and f then value = f(value); end
 				end
 			end
 			if opt == '#' or opt == '%' then
-- 
cgit v1.2.3