diff --git a/editor.planx.uk/src/ui/editor/RichTextInput/RichTextInput.tsx b/editor.planx.uk/src/ui/editor/RichTextInput/RichTextInput.tsx index 5b679ea204..cbf8b53d43 100644 --- a/editor.planx.uk/src/ui/editor/RichTextInput/RichTextInput.tsx +++ b/editor.planx.uk/src/ui/editor/RichTextInput/RichTextInput.tsx @@ -200,8 +200,8 @@ export const emptyContent = "

"; const linkSelectionError = (selectionHtml: string): string | null => { if (selectionHtml.startsWith("

") && selectionHtml.endsWith("

")) { const text = selectionHtml.slice(3, -4); - const lowercaseText = text.toLowerCase(); - if (lowercaseText.includes("click") || lowercaseText.includes("here")) { + const lowercaseText = text.toLowerCase().trim().replace(/[.,]/g, ""); + if (lowercaseText == "click here" || lowercaseText == "clicking here") { return "Links must be set over text that accurately describes what the link is for. Avoid generic language such as 'click here'."; } if (text[0] && text[0] !== text[0].toUpperCase() && text.length < 8) {