aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--static/js/fixedsearch.ts7
-rw-r--r--static/js/index.js6
-rw-r--r--themes/default/layouts/_default/index.json4
-rw-r--r--themes/default/layouts/_default/rss.xml2
4 files changed, 7 insertions, 12 deletions
diff --git a/static/js/fixedsearch.ts b/static/js/fixedsearch.ts
index 3788cb3..2b0abda 100644
--- a/static/js/fixedsearch.ts
+++ b/static/js/fixedsearch.ts
@@ -170,17 +170,14 @@
} else {
dropdown.removeAttribute("hidden");
for (const string in results.slice(0, 10)) {
- const decode = document.createElement("textarea");
- decode.innerHTML = results[string].obj.title;
-
let highlight = fuzzysort.highlight(
- fuzzysort.single(term, decode.value),
+ fuzzysort.single(term, results[string].obj.title),
"<span>",
"</span>",
);
if (highlight === null) {
- highlight = decode.value;
+ highlight = results[string].obj.title;
}
items = items +
diff --git a/static/js/index.js b/static/js/index.js
index 7fc5785..62615e5 100644
--- a/static/js/index.js
+++ b/static/js/index.js
@@ -408,11 +408,9 @@
} else {
dropdown.removeAttribute("hidden");
for(const string in results.slice(0, 10)){
- const decode = document.createElement("textarea");
- decode.innerHTML = results[string].obj.title;
- let highlight = fuzzysort.highlight(fuzzysort.single(term, decode.value), "<span>", "</span>");
+ let highlight = fuzzysort.highlight(fuzzysort.single(term, results[string].obj.title), "<span>", "</span>");
if (highlight === null) {
- highlight = decode.value;
+ highlight = results[string].obj.title;
}
items = items + `
<li>
diff --git a/themes/default/layouts/_default/index.json b/themes/default/layouts/_default/index.json
index ae1e793..b5ec06c 100644
--- a/themes/default/layouts/_default/index.json
+++ b/themes/default/layouts/_default/index.json
@@ -10,8 +10,8 @@
{
"id": "{{ md5 $data.Permalink }}",
"url": "{{ $data.Permalink }}",
- "title": "{{ htmlEscape $data.Summary }}",
- "summary": "{{ $data.Summary }}",
+ "title": "{{ $data.Summary | htmlUnescape }}",
+ "summary": "{{ $data.Summary | htmlUnescape }}",
"date_modified": "{{ $data.Date | time.Format "2006-01-02T15:04:05Z" }}",
"date_published": "{{ $data.PublishDate | time.Format "2006-01-02T15:04:05Z" }}",
"_metadata": {
diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml
index 4570a98..eac25c4 100644
--- a/themes/default/layouts/_default/rss.xml
+++ b/themes/default/layouts/_default/rss.xml
@@ -20,7 +20,7 @@
{{- range $pages -}}
{{ if and (ne .Params.hidden true) (not .Params.Unlisted) (not .ExpiryDate) }}
<item>
- <title>{{ htmlEscape .Summary }}</title>
+ <title>{{ .Summary | htmlUnescape }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid>{{ .Permalink }}</guid>