Hold /privacy behind a flag until counsel reads it, and fix leftover legal and email copy.
This commit is contained in:
1 parent
ead6c8f716
commit
072e5362f5
43 files changed
+548
-191
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { privacyPolicyUrl } from "../privacyPolicyEnabled";
|
||||
|
||||
function escapeHtml(value: string): string {
|
||||
return value
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
${about}`;
|
||||
}
|
||||
Reference in new issue
Block a user