Sommerregen / grav-plugin-external-links

This plugin adds small icons to external and mailto links, informing users the link will take them to a new site or open their email client.
Other
16 stars 14 forks source link

Problem with non UTF-8 characters #4

Closed jjoseba closed 9 years ago

jjoseba commented 9 years ago

When the link's text contains some non UTF-8 characters, they get corrupted somehow. Example:

[AáÉ ‘quote’ ü ¿question?](http://otherdomain.com/ "Title") produces <a href="http://otherdomain.com/" title="Title" target="_blank" rel="nofollow" class="external-link no-image">AáÉ ‘quote’ ü ¿question?</a>

I thought it could be something related with my PHP config, but with the plugin disabled it works normally. Cheers!

Sommerregen commented 9 years ago

Hi @jjoseba,

I tested your example and indeed produced this bug. Ironically you just have to uncomment line 404 in https://github.com/Sommerregen/grav-plugin-external-links/blob/master/classes/ExternalLinks.php#L404 to fix it.

It may lead to other problems, since in the past I commented out this line due some problems I experienced with it, I don't know anymore... It would be good, if you test this fix and leave me a note when getting other issues.

Thanks!

jjoseba commented 9 years ago

Thanks! I'll uncomment that line and let you know about anything I encounter :)

jjoseba commented 9 years ago

It seems to work fine with that line uncommented... I don't see any issue right away. I'm not using anything fancy on my website besides basic templating and the default plugins, so I don't know if it serves you as a real test.