fix(pages): reserve the reg- prefix for the sign-up form's field ids

A block named reg-email would have duplicated the form's input id, so its
label and #reg-email links would bind to the wrong element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-03 09:43:23 +08:00
1 parent 93acebf162
commit 92e62fb3fd
13 files changed
+25 -20

No files matched your search

@@ -20,8 +20,8 @@ import java.util.regex.Pattern;
*/
public final class CmsBlockValidator {
private static final int MAX_BLOCKS = 30;
/** A block link name (add-page-anchor-links); a same-page link is "#" plus one. */
static final Pattern ANCHOR = Pattern.compile("[a-z0-9][a-z0-9-]{0,39}");
/** A block link name (add-page-anchor-links); a same-page link is "#" plus one. "reg-" is the sign-up form's own ids. */
static final Pattern ANCHOR = Pattern.compile("(?!reg-)[a-z0-9][a-z0-9-]{0,39}");
private static final Pattern SCRIPT = Pattern.compile("(?i)<\\s*script|\\son[a-z]+\\s*=|javascript\\s*:");
private CmsBlockValidator() {