fix: unescape HTML entities in result titles
Wikipedia returns HTML entities like <span> which were being double-escaped by Go templates. Now using html.UnescapeString and template.HTML to render properly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
37420ae5a8
commit
23dcdef26f
2 changed files with 13 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{{define "result_item"}}
|
||||
<article class="result">
|
||||
<div class="result_header">
|
||||
<a href="{{.URL}}" target="_blank" rel="noopener noreferrer">{{.Title}}</a>
|
||||
<a href="{{.URL}}" target="_blank" rel="noopener noreferrer">{{.SafeTitle}}</a>
|
||||
</div>
|
||||
<div class="result_url">
|
||||
<img class="result-favicon" src="https://www.google.com/s2/favicons?domain={{.URL | urlquery}}&sz=32" alt="" loading="lazy" onerror="this.style.display='none'">
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<span class="engine-badge">{{.Engine}}</span>
|
||||
</div>
|
||||
{{if .Content}}
|
||||
<p class="result_content">{{.Content}}</p>
|
||||
<p class="result_content">{{.SafeContent}}</p>
|
||||
{{end}}
|
||||
</article>
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue