How can I disable meta format-detection on iOS for dates?

£可爱£侵袭症+ 提交于 2019-11-28 11:20:21

There is no meta way at the moment. However there are two tricks to break the detection.

I advise to split the date/time with a harmless HTML element, like a span:

Mon<span></span>day

Another trick is adding a zero-width space:

Mon&#x200B;day

However this is less stable, for example in the preview text of iOS 6-8, there the zero with space is displayed like a regular space.

CLL

This isn't possible for dates or addresses. Unfortunately, phone numbers are the only type covered in Apple's documentation: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

Add this tag to your header

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

Or just hide it with css by styling the generated links like

your-element-containg-days a {
    color: #000 !important;
    text-decoration: none !important;
        }

You have to add !important to overrule the generated styling.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!