Fix context_text extraction to start from XPointer offset
This commit is contained in:
1 parent
109dedc10f
commit
ec64e1f5d7
1 file changed
+5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user