Microformats testsuite

Microformats phone number formats

Introduction

Although phone numbers are considered to be a string value in the Microformats specifications, some parsers do treat them as a data type and perform different levels of validation. To allow the test-runner to test parsers equally the following method canonicalise and compare phone numbers.

Canonicalise phone number

This code takes a string phone number and provides a canonicalised version.

Compare

This code takes the two phone numbers and compares canonicalised version of them to see if they are equal.

 

Some rights reserved