4
votes

So I get this error when I try to validate it here:

Bad value tel:0000 00 00 00 for attribute href on element a: Illegal character in scheme data: not a URL code point

My html looks like this:

<a href="tel:0000 00 00 00">0000 00 00 00</a>

Is there any way to fix this?

3

3 Answers

4
votes

Take the spaces out. Literal spaces are not allowed in URLs and they are not part of the data of a phone number, just formatting for human consumption.

2
votes

Assuming that the validator is checking the URL against the grammar given in RFC 3966, it's failing on the space characters. Remove those, or replace them with a visual-separator character (e.g. -) and you should be okay.

Example:

<a href="tel:0000-00-00-00">0000 00 00 00</a>

Section 3 of the spec has the grammar. In particular:

phonedigit           = DIGIT / [ visual-separator ]
visual-separator     = "-" / "." / "(" / ")"

See also Section 5.1.1, which says

even though ITU-T E.123 recommends the use of space characters as visual separators in printed telephone numbers, "tel" URIs MUST NOT use spaces in visual separators to avoid excessive escaping.

-3
votes

Don't use a hyperlink. Use microdata. Mobile phones will recognize that it is a phone number and allow it to be clicked but it won't affect normal web browsers.

<div class="vcard">
<div class="tel">
    12345555555
</div>

See: https://stackoverflow.com/a/13409099/3462988