summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-09 00:36:49 +0530
committerArun Isaac2022-07-09 00:36:49 +0530
commit3c39be96a00333e962fd7ceb3a50e475b68b2077 (patch)
tree00532f765cc455e5b2f696ee0df41b57f2c0a357
parent526f422ce50823f7d78be1857f4538f600ffafd9 (diff)
downloadtissue-3c39be96a00333e962fd7ceb3a50e475b68b2077.tar.gz
tissue-3c39be96a00333e962fd7ceb3a50e475b68b2077.tar.lz
tissue-3c39be96a00333e962fd7ceb3a50e475b68b2077.zip
issue: Hyphenate tag in search query if it has spaces.
* tissue/issue.scm (document->sxml): Hyphenate tag in search query if it has spaces.
-rw-r--r--tissue/issue.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/tissue/issue.scm b/tissue/issue.scm
index 5b34c66..2bc6b41 100644
--- a/tissue/issue.scm
+++ b/tissue/issue.scm
@@ -205,8 +205,13 @@ object representing a list of search results."
,(document-title issue))
,@(map (lambda (tag)
(let ((words (string-split tag (char-set #\- #\space))))
- `(a (@ (href ,(string-append "/search?query="
- (uri-encode (string-append "tag:" tag))))
+ `(a (@ (href ,(string-append
+ "/search?query="
+ (uri-encode
+ ;; Hyphenate tag if it has
+ ;; spaces. Xapian accepts hyphenated
+ ;; strings as exact phrases.
+ (string-append "tag:" (sanitize-string tag)))))
(class ,(string-append "tag"
(string-append " tag-" (sanitize-string tag))
(if (not (null? (lset-intersection