use escapehtml for title

This commit is contained in:
Hailey
2025-06-24 14:58:08 -07:00
parent c81ad8efe4
commit f796278329
3 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
import escapeHTML from 'escape-html'
import {type Hole, html} from 'uhtml' import {type Hole, html} from 'uhtml'
export function linkRedirectContents(link: string): Hole { export function linkRedirectContents(link: string): Hole {
return html` return html`
<html> <html>
<head> <head>
<meta http-equiv="refresh" content="0; URL='${link}'" /> <meta http-equiv="refresh" content="0; URL='${escapeHTML(link)}'" />
<meta <meta
http-equiv="Cache-Control" http-equiv="Cache-Control"
content="no-store, no-cache, must-revalidate, max-age=0" /> content="no-store, no-cache, must-revalidate, max-age=0" />
+3 -2
View File
@@ -1,3 +1,4 @@
import escapeHTML from 'escape-html'
import {type Hole, html} from 'uhtml' import {type Hole, html} from 'uhtml'
export function linkWarningContents(opts: { export function linkWarningContents(opts: {
@@ -15,11 +16,11 @@ export function linkWarningContents(opts: {
: 'This link has been identified as malicious and has blocked for your safety.'} : 'This link has been identified as malicious and has blocked for your safety.'}
</p> </p>
<div class="blocked-site"> <div class="blocked-site">
<p class="site-url">${opts.link}</p> <p class="site-url">${escapeHTML(opts.link)}</p>
</div> </div>
<div class="button-group"> <div class="button-group">
${opts.type === 'warn' ${opts.type === 'warn'
? html`<a class="button secondary" href="${opts.link}" ? html`<a class="button secondary" href="${escapeHTML(opts.link)}"
>Continue Anyway</a >Continue Anyway</a
>` >`
: null} : null}
+2 -1
View File
@@ -1,3 +1,4 @@
import escapeHTML from 'escape-html'
import {type Hole, html} from 'uhtml' import {type Hole, html} from 'uhtml'
export function linkWarningLayout( export function linkWarningLayout(
@@ -15,7 +16,7 @@ export function linkWarningLayout(
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>${title}</title> <title>${escapeHTML(title)}</title>
<style> <style>
* { * {
margin: 0; margin: 0;