Skip to content

Commit cf95be5

Browse files
authored
Merge pull request #3 from coliff/dev/coliff/formatting-fixes
Formatting Fixes
2 parents 6dfa162 + 72686ad commit cf95be5

File tree

4 files changed

+81
-43
lines changed

4 files changed

+81
-43
lines changed

.htmlhintrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"tagname-lowercase": true,
2+
"alt-require": true,
33
"attr-lowercase": true,
4+
"attr-no-duplication": true,
45
"attr-value-double-quotes": true,
6+
"attr-value-not-empty": false,
57
"doctype-first": true,
6-
"tag-pair": true,
7-
"spec-char-escape": true,
8+
"doctype-html5": true,
89
"id-unique": true,
10+
"spec-char-escape": true,
911
"src-not-empty": true,
10-
"attr-no-duplication": true,
11-
"title-require": true,
12-
"attr-value-not-empty": false,
13-
"alt-require": true,
14-
"doctype-html5": true
12+
"tag-pair": true,
13+
"tagname-lowercase": true,
14+
"title-require": true
1515
}

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
An email address validator (which includes checking a valid TLD is used) in pure HTML with no JavaScript or dependencies. It could be used to improve the user experience by rejecting mistyped email addresses.
44

55
## Where can I see a demo?
6-
https://coliff.github.io/html5-email-regex/
76

7+
https://coliff.github.io/html5-email-regex/
88

99
## How does it work?
1010

1111
It uses the HTML5 `pattern` attribute and uses the standard email regex [RFC 5322](https://www.w3.org/TR/2012/WD-html-markup-20120320/input.email.html) and expanded to check the end of the email address matches against a list of valid TLDs.
1212

13-
1413
## Is it safe to use?
1514

1615
Kind of, but a few points:
@@ -23,7 +22,6 @@ Kind of, but a few points:
2322

2423
- It doesn't give meaningful feedback if an email address is mistyped. So if someone enters `[email protected]` they'll get an invalid message, but won't specify that the TLD is incorrect. I've used [Verimail](https://github.com/amail/Verimail.js) and [Mailcheck](https://github.com/mailcheck/mailcheck) with success before to give inline feedback on mistyped email addresses.
2524

26-
2725
## Are there any other recommended HTML attributes to add?
2826

2927
- Always use `type="email"` rather than `type="text"` to take advantage of browser-based validation and feedback and provide hints to autocomplete/autofill users email address.
@@ -34,7 +32,6 @@ Kind of, but a few points:
3432

3533
- If it's an order form/contact form or similar add the `required` tag to prevent submissions when this field is empty.
3634

37-
3835
## How did you get the list of valid TLDs?
3936

4037
I scraped the official list with this command:

0 commit comments

Comments
 (0)