From c1739b1eb71b2dcb0c150963e153cf1429f8047d Mon Sep 17 00:00:00 2001 From: Ute Hahn Date: Tue, 26 Mar 2024 00:14:10 +0100 Subject: [PATCH] bugfix fix problem when new chapters are added, https://github.com/ute/qquestion/issues/1#issue-2203953179 --- .gitignore | 2 ++ _extensions/qquestion/_extension.yml | 2 +- _extensions/qquestion/projectutils.lua | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 65d5bce..c98bfbf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ Emo_think.png _renderinfo.json quickanswers.tex +_renderinginfo + diff --git a/_extensions/qquestion/_extension.yml b/_extensions/qquestion/_extension.yml index becaea5..b732cde 100644 --- a/_extensions/qquestion/_extension.yml +++ b/_extensions/qquestion/_extension.yml @@ -1,6 +1,6 @@ title: qquestion author: Ute Hahn -version: 0.4.0 +version: 0.4.5 quarto-required: ">=1.4.0" contributes: filters: diff --git a/_extensions/qquestion/projectutils.lua b/_extensions/qquestion/projectutils.lua index 138b82c..53d5c3d 100644 --- a/_extensions/qquestion/projectutils.lua +++ b/_extensions/qquestion/projectutils.lua @@ -130,6 +130,7 @@ local function update_otherchapinfo(rinfo, newinfo) local oldchap = rinfo.rendr local newchap = newinfo.rendr local OK = true + local nnew = #newchap if rinfo.isbook then --pout(newchap) iexclude = rinfo.currentindex @@ -139,7 +140,9 @@ local function update_otherchapinfo(rinfo, newinfo) if OK then -- pout("checking chap "..i) -- pout("names: old "..v.file.." - new: "..newchap[i].file) - OK = v.file == newchap[i].file + if i > nnew then OK = false + else OK = v.file == newchap[i].file + end end end if not OK then