From 973c785dccc1812d63162178e8362e83e8c263c2 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 5 Jul 2023 03:01:54 +0000 Subject: CTAN sync 202307050301 --- biblio/citation-style-language/citeproc-node-label.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'biblio/citation-style-language/citeproc-node-label.lua') diff --git a/biblio/citation-style-language/citeproc-node-label.lua b/biblio/citation-style-language/citeproc-node-label.lua index 6f89bdb123..5c0ee9bf98 100644 --- a/biblio/citation-style-language/citeproc-node-label.lua +++ b/biblio/citation-style-language/citeproc-node-label.lua @@ -91,18 +91,14 @@ function Label:_is_variable_plural(variable, context) return value and tonumber(value) > 1 else value = tostring(value) - -- label_CollapsedPageNumberPluralDetection.txt - -- 327\-30 => single - value = string.gsub(value, "\\%-", "") - if string.match(value, "[,&-]") then - return true - elseif string.match(value, util.unicode["en dash"]) then - return true - elseif string.match(value, "%Wand%W") then - return true - elseif string.match(value, "%Wet%W") then - return true + local tokens = self:parse_number_tokens(value, context) + local num_numeric_tokens = 0 + for _, token in ipairs(tokens) do + if token.type == "number" then + num_numeric_tokens = num_numeric_tokens + 1 + end end + return num_numeric_tokens > 1 end end return false -- cgit v1.2.3