Skip to content

Commit

Permalink
fix(classes): Coerce option values to booleans
Browse files Browse the repository at this point in the history
Co-authored-by: Omikhleia <didier.willis@gmail.com>
  • Loading branch information
alerque and Omikhleia committed Jan 26, 2023
1 parent e3a70fd commit d046a8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/base.lua
Expand Up @@ -417,7 +417,7 @@ function class:registerCommands ()
end, "Declares (or re-declares) a frame on this page.")

self:registerCommand("penalty", function (options, _)
if options.vertical and not SILE.typesetter:vmode() then
if SU.boolean(options.vertical, false) and not SILE.typesetter:vmode() then
SILE.typesetter:leaveHmode()
end
if SILE.typesetter:vmode() then
Expand Down Expand Up @@ -458,7 +458,7 @@ function class:registerCommands ()
end, "Inserts a glue node. The width option denotes the glue dimension.")

self:registerCommand("skip", function (options, _)
options.discardable = options.discardable or false
options.discardable = SU.boolean(options.discardable, false)
options.height = SILE.length(options.height):absolute()
SILE.typesetter:leaveHmode()
if options.discardable then
Expand Down

0 comments on commit d046a8a

Please sign in to comment.