From 3800a3077ab95a404e4e7574e2bf6b02404b4565 Mon Sep 17 00:00:00 2001 From: Sergey Organov Date: Thu, 1 Dec 2016 15:34:40 +0300 Subject: [PATCH] DictQuickLookup:update(): strip all leading empty lines/spaces This gets rid of sometimes huge spacing between a word and its description taken from dictionary, and thus need for scrolling just to read fisrs few lines of description. --- frontend/apps/reader/modules/readerdictionary.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index 3d2104247..9a93b22e6 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -57,6 +57,8 @@ local function tidy_markup(results) end -- ignore all markup tags def = def:gsub("%b<>", "") + -- strip all leading empty lines/spaces + def = def:gsub("^%s+", "") result.definition = def end return results