Hide Phone Numbers From Skype Using the HTML Soft Hyphen
by J. Michael Ambrosio
Saturday, April 10th, 2010
I ran into an annoying problem while updating my web site recently. I have Skype installed and running on my Windows desktop. Skype is a great application; I use it all the time, and I recommend it to others. However, while testing my site in Internet Explorer, I noticed something I had never seen before (probably because I never use IE for my personal web browsing): Skype added some unwanted link formatting to the phone number in my site header, as you can see here.
This formatting only shows up in IE (yet another reason to dislike that browser). To my eye, it looks rather gaudy, like something you might see in a cheap late-night infomercial. Even worse, the extra width added to the phone number was throwing off the layout of my site header.
Clearly something had to be done. A quick search turned up this thread on the Skype community forums:
I was disappointed to learn that this had been reported to the Skype developers as a problem over three years ago, and still nothing has been done about it. Apparently, Skype views this as a “feature” which they are unwilling to disable—their recommended solutions include asking the client to “turn off highlighting from the Skype button on the toolbar when he visits your site” (I’m sure my clients will appreciate that suggestion), and a vendor-specific meta tag which does not validate and does not always work.
Fortunately, I was able to find a simple solution, in the unexpected form of the HTML soft hyphen. The HTML 4 specification has this to say about it:
“The soft hyphen tells the user agent where a line break can occur. Those browsers that interpret soft hyphens must observe the following semantics: If a line is broken at a soft hyphen, a hyphen character must be displayed at the end of the first line. If a line is not broken at a soft hyphen, the user agent must not display a hyphen character.”
The intent of the soft hyphen is to allow content authors to aid the justification of text by specifying how a word may be split across two lines. However, I found that it may also be used to hide a phone number from Skype, simply by inserting the soft hyphen character ( ­ ) between the area code and the exchange:
As long as the phone number does not break across two lines, the soft hyphen is not displayed:
In exchange for adding one character of non-semantic markup to our page, we get a solution that is quick and easy to implement, easy to remember, passes validation, and works in all browsers including IE6!
I really hope Skype listens to their user base, and turns this “feature” off by default in future releases. Until then, the HTML soft hyphen offers a painless way to get rid of the Skype link on phone numbers.
More From the Blog
- Seeking Beta Testers for Next/Previous Post Link Plus 2.0
- Clean Up WordPress Revisions Using a MySQL Multi-Table Delete
- Truncate Long Titles to the Nearest Whole Word Using PHP strrpos
- It’s Official: WordPress is Not Just a Blog Any More
- Shorten Category Names in WordPress Dropdown Menus