You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// hyphen rules (the other one is covered by bidi)
98
+
if(/^-|-$/.test(label))throwIdnaSyntaxError('Label cannot begin or end with hyphen-minus (RFC 5891 §4.2.3.1).');
105
99
if(label.indexOf('--')===2)throwIdnaSyntaxError('Label cannot contain consecutive hyphen-minus in the 3rd and 4th positions (RFC 5891 §4.2.3.1).');
106
100
// leading combining marks check (some are not covered by bidi)
107
101
if(/^\p{M}$/u.test(String.fromCodePoint(label.codePointAt(0))))throwIdnaSyntaxError(`Label cannot begin with combining/enclosing mark ${cpHex(label.codePointAt(0))} (RFC 5891 §4.2.3.2).`);
for(letclsofbidiClasses)if(!['R','AL','AN','EN','ET','ES','CS','ON','BN','NSM'].includes(cls))throwIdnaBidiError(`'${label}' breaks rule #2: Only R, AL, AN, EN, ET, ES, CS, ON, BN, NSM allowed in label (RFC 5893 §2.2)`);
156
147
if(!/(R|AL|EN|AN)(NSM)*$/.test(bidiClasses.join('')))throwIdnaBidiError(`'${label}' breaks rule #3: label must end with R, AL, EN, or AN, followed by zero or more NSM (RFC 5893 §2.3)`);
0 commit comments