RTE stripping tel: links

ChadLeathers

01-09-2020

Is there a known workaround for Authors to link phone numbers within an RTE in a way the "tel:"  doesn't get stripped out ? 
 
If we put this in an RTE : 
<a href="tel:123-456-7890">123-456-7890</a> 
 
It removes the href 
 
RTE RTE Hyperlink issue

Answers (1)

Answers (1)

BrianKasingli

MVP

01-09-2020

You will need to add the special link prefix via OSGI console (OSGI configuration),

  1. Visit http://localhost:4502/system/console/configMgr/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl
  2. From the Special link prefixes, add "tel:"
  3. Save.
  4. Test.

This will enable the special link prefix only in the author environment. It's best practice to store this OSGI configuration in your code, so the configuration is distributed throughout your AEM environments upon content package installation.

Simply create an XML file under /apps/my-site/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl.xml, with the following context:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="sling:OsgiConfig"
    scheduler.concurrent="{Boolean}false"
    scheduler.period="{Long}5"
    service.bad_link_tolerance_interval="{Long}48"
    service.cache_broken_internal_links="{Boolean}false"
    service.check_override_patterns="[^system/]"
    service.special_link_patterns=""
    service.special_link_prefix="[javascript&colon;,data:,mailto:,#,&lt;!--,${,http:,https:,tel:]"/>