HTML validation. Website is invalid when using tel inside href
3 answers
Assuming the validator validates the URL against the grammar given in RFC 3966 , it does not work on whitespace characters. Remove them or replace them with a character visual-separator
(like -
) and you should be fine.
Example:
<a href="tel:0000-00-00-00">0000 00 00 00</a>
Section 3 of the specification has a grammar. In particular:
phonedigit = DIGIT / [ visual-separator ]
visual-separator = "-" / "." / "(" / ")"
See also Section 5.1.1 which says
although ITU-T E.123 recommends using spaces as visual separators in printed telephone numbers, tel URIs MUST NOT use spaces in visual separators to avoid overspeeding.
+2
source to share