summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-29 11:51:14 +0530
committerArun Isaac2022-06-29 11:51:14 +0530
commitb6ff5be83fa077cd64cbe37e646cc260fe67cfc5 (patch)
tree20139aefdc0d3b0d5a353e5cf286160a702ae777
parentefec16853cce7a497010a2da42844a7bc0bd704f (diff)
downloadtissue-b6ff5be83fa077cd64cbe37e646cc260fe67cfc5.tar.gz
tissue-b6ff5be83fa077cd64cbe37e646cc260fe67cfc5.tar.lz
tissue-b6ff5be83fa077cd64cbe37e646cc260fe67cfc5.zip
document: Remove blank lines in search snippets.
Blank lines waste precious space in search snippets. * tissue/document.scm (document-html-snippet): Remove blank lines in search snippets.
-rw-r--r--tissue/document.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/tissue/document.scm b/tissue/document.scm
index b549f2d..cc49010 100644
--- a/tissue/document.scm
+++ b/tissue/document.scm
@@ -177,7 +177,11 @@ and further text, increase-termpos! must be called before indexing."
"Return snippet for DOCUMENT. MSET is the xapian MSet object
representing a list of search results."
(mset-snippet mset
- (document-text document)
+ (string-join
+ (remove (cut string-every char-set:whitespace <>)
+ (string-split (document-text document)
+ #\newline))
+ "\n")
#:length 200
#:highlight-start "<b>"
#:highlight-end "</b>"