Mercurial > prosody-hg
comparison util/interpolation.lua @ 11307:f2e276bb4ef8
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 25 Jan 2021 21:26:45 +0100 |
| parents | af1e3b7d9ea3 5798ab735619 |
| children |
comparison
equal
deleted
inserted
replaced
| 11305:cd8516a77255 | 11307:f2e276bb4ef8 |
|---|---|
| 41 value = value[word]; | 41 value = value[word]; |
| 42 if not value then break; end | 42 if not value then break; end |
| 43 end | 43 end |
| 44 end | 44 end |
| 45 if funcs then | 45 if funcs then |
| 46 while value ~= nil and opt == '|' do | 46 while opt == '|' do |
| 47 local f; | 47 local f; |
| 48 f, raw, opt, e = s_match(block, "^([%a_][%w_.]*)(!?)(%p?)()", e); | 48 f, raw, opt, e = s_match(block, "^([%a_][%w_.]*)(!?)(%p?)()", e); |
| 49 f = funcs[f]; | 49 f = funcs[f]; |
| 50 if f then value = f(value); end | 50 if value ~= nil and f then value = f(value); end |
| 51 end | 51 end |
| 52 end | 52 end |
| 53 if opt == '#' or opt == '%' then | 53 if opt == '#' or opt == '%' then |
| 54 if type(value) ~= "table" then return ""; end | 54 if type(value) ~= "table" then return ""; end |
| 55 local iter = opt == '#' and ipairs or pairs; | 55 local iter = opt == '#' and ipairs or pairs; |
