console fill: labels match straight and curly quotes (Developer’s Advertising, the user’s identity); an App Privacy dialog step with no inputs (the definitions page) is passed with Next
This commit is contained in:
parent
0035931734
commit
18fde37b9b
4 changed files with 33 additions and 9 deletions
|
|
@ -38,7 +38,11 @@ export interface SectionDef {
|
|||
|
||||
export interface FormDef { id: FormId; sections: SectionDef[] }
|
||||
|
||||
const esc = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
// Console labels use typographic quotes ("Developer’s Advertising", "the user’s identity"): every pattern built from a
|
||||
// label accepts straight and curly quotes alike.
|
||||
const esc = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/['\u2018\u2019]/g, "['\u2018\u2019]").replace(/["\u201c\u201d]/g, '["\u201c\u201d]');
|
||||
/** A label as an exact-match pattern that tolerates straight vs curly quotes (for names that contain a quote). */
|
||||
export const quoteTolerant = (s: string): RegExp => new RegExp(`^${esc(s)}$`);
|
||||
const yesNo = (yes: Name[] = ['Yes'], no: Name[] = ['No']): Record<string, Name[]> => ({ true: yes, false: no });
|
||||
|
||||
/** IARC topics -> candidate radiogroup names (modeled; see the header). */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue