Skip to content

Commit

Permalink
[v1.9] html decode ondemand
Browse files Browse the repository at this point in the history
  • Loading branch information
Huxpro committed Jun 21, 2020
1 parent 3e97c55 commit 1ef4318
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,12 @@
// a hack to get escaped subtitle unescaped. for some reason,
// post.subtitle w/o escape filter nuke entire search.
templateMiddleware: function (prop, value, template) {
if (prop === 'subtitle') {
console.log(prop, value)
return htmlDecode(value);
if (prop === 'subtitle' || prop === 'title') {
if (value.indexOf("code")) {
return htmlDecode(value);
} else {
return value;
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: null
[
{% for post in site.posts %}
{
"title" : "{{ post.title }}",
"title" : "{{ post.title | escape }}",
"subtitle" : "{{ post.subtitle | escape }}",
"tags" : "{{ post.tags | join: ', ' }}",
"url" : "{{ site.baseurl }}{{ post.url }}",
Expand Down

0 comments on commit 1ef4318

Please sign in to comment.