webmcp
changeset 112:407633fd0e84
Changed default for 'truncate_count_suffix' in string.format
author | jbe |
---|---|
date | Mon Jan 13 21:40:27 2014 +0100 (2014-01-13) |
parents | 43986d8dacf3 |
children | ca88032cb37c |
files | framework/env/format/string.lua |
line diff
1.1 --- a/framework/env/format/string.lua Mon Jan 13 21:37:23 2014 +0100 1.2 +++ b/framework/env/format/string.lua Mon Jan 13 21:40:27 2014 +0100 1.3 @@ -8,7 +8,7 @@ 1.4 -- (currently only "codepoints" are supported and this option may be omitted) 1.5 truncate_at = truncate_at, -- truncate string after the given number of UTF-8 codepoints (or Unicode grapheme clusters) 1.6 truncate_suffix = truncate_suffix, -- string to append, if string was truncated (use boolean true for Unicode ellipsis) 1.7 - truncate_count_suffix = truncate_count_suffix -- unless explicitly set to false, the total length (including suffix) may not exceed the given length 1.8 + truncate_count_suffix = truncate_count_suffix -- if true, then the total length (including suffix) may not exceed the given length 1.9 } 1.10 ) 1.11 1.12 @@ -89,7 +89,7 @@ 1.13 elseif not truncate_suffix then 1.14 truncate_suffix = '' 1.15 end 1.16 - if options.truncate_count_suffix ~= false and truncate_suffix then 1.17 + if options.truncate_count_suffix and truncate_suffix then 1.18 local suffix_length = codepoint_count(truncate_suffix) 1.19 if codepoint_count(str) > options.truncate_at then 1.20 return (