• Thanks for this great plugin.

    I have noticed that using [encode link=”…”][/encode] around text works perfectly, but not around </img>. That is, the encoding happens, but the image does not get displayed.

    Curiously, when not tagging manually, that is, when relying on the auto-encoding functionality (that targets emails only), then everything works for emails – but telephone numbers are not encoded.

    Would it be possible to make explicit [encode][/encode] work around images, when images are used instead of text as links?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Yeah, we could do that.

    Can you link me an example to a page that fails to encode images, or paste a code example?

    Thread Starter andradess

    (@andradess)

    No website that I can immediately link to, but a quick example is easy to come up with (using the plugin’s thumbnail as a link image).

    The following works:

    [encode link="tel:+15551234567"]+1 (555) 123-4567[/encode]

    The following does not:

    [encode link="tel:+15551234567"]<img src="https://ps.w.org/email-address-encoder/assets/icon-128x128.jpg" alt="">[/encode]

    While the phone number within the [encode link=”…”] parameter is encoded, the image does not get displayed (instead, the html code is displayed: <img src="https://ps.w.org/email-address-encoder/assets/icon-128x128.jpg" alt="" />.

    • This reply was modified 3 years, 8 months ago by andradess.
    • This reply was modified 3 years, 8 months ago by andradess.
    • This reply was modified 3 years, 8 months ago by andradess.
    • This reply was modified 3 years, 8 months ago by andradess.
    • This reply was modified 3 years, 8 months ago by andradess.
    Thread Starter andradess

    (@andradess)

    Oh, forgot to tag you @tillkruess so you know I replied.

    • This reply was modified 3 years, 8 months ago by andradess.
    Plugin Author Till Krüss

    (@tillkruess)

    Currently the content inside the shortcode gets encoded as well:
    https://plugins.trac.www.ads-software.com/browser/email-address-encoder/trunk/email-address-encoder.php#L109

    We’d need to add another shortcode attribute like

    
    [encode link="tel:+12345678" is-html="1"]<img src="..." />[/encode]
    

    Thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Encoding tel when link is an image’ is closed to new replies.