diff --git a/_sass/search.scss b/_sass/search.scss index c740ad94c59c2ded7af1a69fe232786b7478c375..a8b6a8e14fe63f64fd1a89f83802d7ddfbaa85a8 100644 --- a/_sass/search.scss +++ b/_sass/search.scss @@ -129,6 +129,7 @@ display: inline-block; width: 40%; vertical-align: top; + word-wrap: break-word; } } @@ -145,6 +146,7 @@ @include mq(sm) { display: inline-block; width: 60%; + vertical-align: top; } } diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js index e5a44496b7d7b7eb2f6f05f4c6f5852b8863f2cd..ff9b0413a5bc65f5e71c12aca7f4fc005c0458df 100644 --- a/assets/js/just-the-docs.js +++ b/assets/js/just-the-docs.js @@ -42,6 +42,7 @@ function initSearch() { // Success! var data = JSON.parse(request.responseText); + lunr.tokenizer.separator = /[\s\-/]+/ var index = lunr(function () { this.ref('id'); this.field('title', { boost: 200 }); @@ -220,7 +221,7 @@ function initSearch() { var nextSpace = doc.content.indexOf(' ', previewEnd + 1); var nextDot = doc.content.indexOf('.', previewEnd + 1); if ((nextDot > 0) && (nextDot < nextSpace)) { - previewEnd = nextDot + 1; + previewEnd = nextDot; ellipsesAfter = false; break; } @@ -238,7 +239,7 @@ function initSearch() { preview += '<span class="search-result-highlight">' + doc.content.substring(start, end) + '</span>'; preview += doc.content.substring(end, previewEnd); if (ellipsesAfter) { - preview += '...'; + preview += ' ...'; } var resultPreview = document.createElement('div'); diff --git a/assets/js/search-data.json b/assets/js/search-data.json index 49cbc9dcbc2eeea44a9d48c8f0cbf3a14def27a9..f0ec51f22424c52706118145dd784d61c05b6f73 100644 --- a/assets/js/search-data.json +++ b/assets/js/search-data.json @@ -4,7 +4,7 @@ {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": { "id": "{{ forloop.index0 }}", "title": "{{ page.title | replace: '&', '&' }}", - "content": "{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | normalize_whitespace }}", + "content": "{{ page.content | markdownify | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '</ul', ' . </ul' | replace: '</tr', ' . </tr' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | replace: ' . . . ', ' . ' | replace: ' . . ', ' . ' | normalize_whitespace }}", "url": "{{ page.url | absolute_url }}", "relUrl": "{{ page.url }}" }{% unless forloop.last %},{% endunless %}