Skip to content

Commit

Permalink
chore(packages): Deprecate undocumented counter option on lorem
Browse files Browse the repository at this point in the history
Item from sile-typesetter#1351 (low-hanging fruit)
  • Loading branch information
Omikhleia authored and Didier Willis committed May 3, 2023
1 parent 1b90b90 commit a2f3416
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/lorem/init.lua
Expand Up @@ -75,7 +75,8 @@ function package:registerCommands ()

self:registerCommand("lorem", function (options, _)
local words = tonumber(options.words) or 50
local counter = options.counter or false
local counter = SU.boolean(options.counter, false)

local times = math.floor(words/nwords)
words = words - times*nwords
local pos = 0
Expand All @@ -84,6 +85,7 @@ function package:registerCommands ()
end
local text = string.rep(lorem, times) .. lorem:sub(1, pos)
if counter then
SU.deprecated("\\lorem with counter", nil, "0.14.10", "0.16.0")
local c = 0
text = string.gsub(text, "(%s+)", function (_)
c = c + 1
Expand Down

0 comments on commit a2f3416

Please sign in to comment.