From d87b09d11c84810108cce7d0c4964424ba3244e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Tue, 9 Jun 2020 17:07:51 +0200 Subject: [PATCH] handle newlines in exported pdf highlights (#6247) --- frontend/document/koptinterface.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 9930aa3be..5df4cec1e 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -826,6 +826,9 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1) line_text = line_text..word..space end end + -- append a space at the end of the line unless its a hyphenated word + line_text = line_text .. " " + line_text = line_text:gsub("- $", "") -- insert line box local lb = boxes[i] if i > i_start and i < i_stop then