Hold /privacy behind a flag until counsel reads it, and fix leftover legal and email copy.

This commit is contained in:
adilallo committed 2026-11-20 15:36:06 -07:00
1 parent ead6c8f716
commit 072e5362f5
43 files changed
+548 -191

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
import { privacyPolicyUrl } from "../privacyPolicyEnabled";
function escapeHtml(value: string): string {
return value
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;");
}
export function mailLegalFooterUrls(origin: string): {
aboutUrl: string;
privacyUrl: string | null;
} {
const base = origin.replace(/\/$/, "");
return {
aboutUrl: `${base}/about`,
privacyUrl: privacyPolicyUrl(base),
};
}
/** HTML Privacy + About links. Omits Privacy while the policy flag is off. */
export function mailLegalFooterHtml(origin: string): string {
const { aboutUrl, privacyUrl } = mailLegalFooterUrls(origin);
const about = `<a href="${escapeHtml(aboutUrl)}" style="color:#464646;text-decoration:underline;">About CommunityRule</a>`;
if (!privacyUrl) return about;
return `<a href="${escapeHtml(privacyUrl)}" style="color:#464646;text-decoration:underline;">Privacy</a>
&nbsp;&nbsp;
${about}`;
}