X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..b439ad7f35e01bc02e281044fd8a58c24d92900d:/src/search/custom.py?ds=sidebyside

diff --git a/src/search/custom.py b/src/search/custom.py
index dfface953..da21e019e 100644
--- a/src/search/custom.py
+++ b/src/search/custom.py
@@ -184,5 +184,6 @@ class CustomSolrInterface(sunburnt.SolrInterface):
             off = -start
             snip = snip[:e + off] + mark[1] + snip[e + off:]
             snip = snip[:s + off] + mark[0] + snip[s + off:]
+        snip = re.sub('%s[ \t\n]+%s' % (mark[1], mark[0]), " ", snip)
 
         return snip