Skip to content

Commit 6bc8b7f

Browse files
committed
Use version comparison (<=) instead of equality check
pandoc.types.Version provides element-wise comparison so older version args (e.g. 1.8 when main is at 1.9) correctly resolve to quarto.org instead of prerelease.quarto.org.
1 parent 14b9f53 commit 6bc8b7f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

_extensions/prerelease-docs-url/prerelease-docs-url.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ local function handler(args, kwargs, meta)
1919
return pandoc.Str("prerelease.")
2020
end
2121

22-
-- Compare referenced version to this branch's version
23-
local branch_version = pandoc.utils.stringify(meta["version"])
22+
-- Compare referenced version to this branch's version using
23+
-- pandoc.types.Version for correct element-wise comparison (1.12 > 1.9)
24+
local branch_version = pandoc.types.Version(pandoc.utils.stringify(meta["version"]))
25+
local ref = pandoc.types.Version(ref_version)
2426

25-
if ref_version == branch_version then
27+
if ref <= branch_version then
2628
return pandoc.Str("")
2729
else
2830
return pandoc.Str("prerelease.")

0 commit comments

Comments
 (0)