diff --git a/news/changelog-1.7.md b/news/changelog-1.7.md index 8912205b900..c8be3cbabb3 100644 --- a/news/changelog-1.7.md +++ b/news/changelog-1.7.md @@ -57,6 +57,7 @@ All changes included in 1.7: - ([#11699](https://github.com/quarto-dev/quarto-cli/issues/11699)): Fix crash with `video` shortcode inside HTML comments. - Expose new `quarto.paths.tinytex_bin_dir` in Quarto's Lua API. If TinyTeX is found by Quarto, this will be set to the path to the `bin` directory of the TinyTeX installation where command line tool are located (e.g., `pdflatex`, `tlmgr`, etc.). If TinyTeX is not found, this will be `nil`, meaning Quarto will use the system PATH to find the command line tools. - Fix `pandoc.mediabag` Lua typings so autocompletions work with the Lua LSP integration. +- ([#11664](https://github.com/quarto-dev/quarto-cli/issues/11664)): `lipsum` shortcode is no longer randomly generated by default, use `{{< lipsum random=true >}}` to restore randomness. ## Engines diff --git a/src/resources/extensions/quarto/lipsum/lipsum.lua b/src/resources/extensions/quarto/lipsum/lipsum.lua index 57e53e820b4..d1f359f76e2 100644 --- a/src/resources/extensions/quarto/lipsum/lipsum.lua +++ b/src/resources/extensions/quarto/lipsum/lipsum.lua @@ -36,6 +36,14 @@ local barePattern = '^(%d+)$' return { ['lipsum'] = function(args, kwargs, meta) + local isRandom = false + if kwargs and kwargs["random"] then + local randomVal = pandoc.utils.stringify(kwargs["random"]) + if randomVal == "true" then + isRandom = true + end + end + local paraStart = 1 local paraEnd = 5 @@ -58,7 +66,9 @@ return { -- a number of paragraphs is specified, like 10 local _,_,bareVal = range:find(barePattern) if bareVal then - paraStart = math.random(1, 17) + if isRandom then + paraStart = math.random(1, 17) + end local endNumber = tonumber(bareVal) if endNumber ~= nil then paraEnd = paraStart + endNumber - 1 diff --git a/tests/docs/smoke-all/2025/01/29/issue-11664.qmd b/tests/docs/smoke-all/2025/01/29/issue-11664.qmd new file mode 100644 index 00000000000..b82ed3feabd --- /dev/null +++ b/tests/docs/smoke-all/2025/01/29/issue-11664.qmd @@ -0,0 +1,10 @@ +--- +format: html +_quarto: + tests: + html: + ensureFileRegexMatches: + - ["Nunc ac dignissim magna. Vestibulum vitae egestas elit."] +--- + +{{< lipsum 2 >}}