views:

174

answers:

1

I once had a problem where Safari for iPhone would add phone links to my HTML. This would break my code because it depended on the text value of <div id="DontTouchMyHTML">.

Before:

<div id="DontTouchMyHTML">8211812</div>

After:

<div id="DontTouchMyHTML"><a href="tel:8211812">8211812</a></div>

So i added the magical meta fix for IE iPhone Safari. Safari Dev Center: Phone LInks

<meta name = "format-detection" content = "telephone=no">

And that solved the problem.

But then came along the Palm Pre webOS with Safari. Now I'm having the some problem and the above fix does not work. I assumed that being based off Safari/AppleWebKit it would follow the same rules. I guess not.

I've looked for a developer reference for Palm Pre webOS phone links but cannot find a solution.

Offending User Agent:

Mozilla/5.0 (webOS/1.3.1; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0
+1  A: 

You could determine if the useragent is a browser that will convert these numbers to links, and then use HTML Entities to convert 8211812 to

&#0038;&#0032;&#0031;&#0031;&#0038;&#0031;&#0032;

However I honestly think it's a horrible solution.

Providing there is no developer API to prevent your situation, that's the only way I can think of.

Aequitarum Custos

related questions