Fix search excerpts that run together
This commit is contained in:
parent
c56818ccbf
commit
d8bf02262a
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Fixed
|
||||
- Fix Firefox [flexbox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=939897) when printing pages.
|
||||
- Fix search excerpts that run together because of implied spaces.
|
||||
|
||||
## [1.3.1] - 2018-02-16
|
||||
|
||||
|
|
|
@ -14,9 +14,25 @@ var store = [
|
|||
"title": {{ doc.title | jsonify }},
|
||||
"excerpt":
|
||||
{%- if site.search_full_content == true -%}
|
||||
{{ doc.content | strip_html | strip_newlines | jsonify }},
|
||||
{{ doc.content |
|
||||
replace:"</p>", " " |
|
||||
replace:"</h1>", " " |
|
||||
replace:"</h2>", " " |
|
||||
replace:"</h3>", " " |
|
||||
replace:"</h4>", " " |
|
||||
replace:"</h5>", " " |
|
||||
replace:"</h6>", " "|
|
||||
strip_html | strip_newlines | jsonify }},
|
||||
{%- else -%}
|
||||
{{ doc.content | strip_html | strip_newlines | truncatewords: 50 | jsonify }},
|
||||
{{ doc.content |
|
||||
replace:"</p>", " " |
|
||||
replace:"</h1>", " " |
|
||||
replace:"</h2>", " " |
|
||||
replace:"</h3>", " " |
|
||||
replace:"</h4>", " " |
|
||||
replace:"</h5>", " " |
|
||||
replace:"</h6>", " "|
|
||||
strip_html | strip_newlines | truncatewords: 50 | jsonify }},
|
||||
{%- endif -%}
|
||||
"categories": {{ doc.categories | jsonify }},
|
||||
"tags": {{ doc.tags | jsonify }},
|
||||
|
|
Loading…
Reference in New Issue