Fix context_text extraction to start from XPointer offset

This commit is contained in:
2026-05-31 20:55:27 -04:00
parent 109dedc10f
commit ec64e1f5d7
+5
View File
@@ -675,6 +675,11 @@ function Bookhoard:getContextText()
end
if not text or text == "" then return "" end
local char_offset = tonumber(xp:match("text%(%)%.?(%d+)")) or 0
if char_offset > 0 and char_offset < #text then
text = text:sub(char_offset + 1)
end
if #text > 100 then
text = text:sub(1, 100)
end