Support » Plugin: Scriptless Social Sharing » turning special characters in the title into code.

  • Recently this

    For instance, an em-dash gets turned into the html for that character.

    
    Book Review -- Trout Fishing in America by Richard Brautigan
    
    
    Book Review — Trout Fishing in America by Richard Brautigan
    

    How can we get it not to do this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Sorry, the example didn’t post correctly. The em-dash is rendered as the code for an emdash instead.

    Plugin Author Robin Cornett

    (@littlerchicken)

    Can you confirm that you are using the latest version of the plugin, version 2.0.1? This is one of the issues I attempted to address in that release, and the em-dash works correctly for me with on a local test.

    If you are on the latest version, can you please let me know what browser this is happening in, and which button (I’m assuming Twitter because that one has the most issues here), and possibly a URL to the affected post, please? Thanks.

    Hi Robin, thanks for your reply. Sorry it took me so long to get back here.

    I am using the most recent version of the plugin. I’m using Chrome and yes, it is only Twitter that it’s happening with.

    It’s happening with em-dashes on many pages (–), etc.

    Here’s are some examples:
    https://www.emptymirrorbooks.com/music/ringo-starr-come-on-christmas-christmas-come-on
    https://www.emptymirrorbooks.com/reviews/book-review-trout-fishing-in-america-by-richard-brautigan

    Thanks for your help! I love this plugin otherwise. 🙂

    • This reply was modified 2 years, 1 month ago by quantaweb.
    Plugin Author Robin Cornett

    (@littlerchicken)

    I think I may know where the issue is coming from, but will take me some time to suss out how to tackle it. When I copied/pasted one of your titles from your site into a local site to test it, the html code did not show. When I copied/pasted the same title from the twitter share link on your site into my local site, the html code did show. I compared what the titles looked like in the database and they looked like this:

    
    Ringo Starr – Come on Christmas, Christmas Come On! (copied from site, works in Twitter)
    Ringo Starr &# 8211; Come on Christmas, Christmas Come On! (copied from Twitter window, does not work in Twitter, but visually appears correct (space added because it rendered here on the forum))
    

    So, not knowing for sure if this is how you add the em dash to your titles, I’m guessing that you add them using the HTML character code, and WordPress correctly converts it to the em dash.

    The plugin has to convert special characters into their HTML codes to not break the sharing URLs (Twitter URLs have been the hardest), but if I’m correct, this needs to accounts for special characters already rendered into HTML codes, and not convert them again….or something (forgive me, I am thinking out loud here).

    One way to test it, if you would not mind, is to edit an affected post and change the title to use a copied/pasted em dash, not the character coding, even though WordPress correctly converts it (this is assuming I’m correct about what your database looks like). That should fix the sharing link, and I can dig on my end about how to handle this properly in the plugin, assuming this is where the issue is.

    Thank you for your patience–I appreciate it.

    • This reply was modified 2 years, 1 month ago by Robin Cornett. Reason: fixing special character
    Plugin Author Robin Cornett

    (@littlerchicken)

    I’ve been poking at this today to hopefully find a solution which properly handles special characters regardless of how they’re stored in the database. I think I have a solution and I wanted to share it here to see if you would be able/willing to test it.

    I’ve updated the relevant plugin file (class-scriptlesssocialsharing-output.php). If you are able to FTP in and replace this file on your site (it’s in the plugin’s includes directory), we can verify if it does fix the issue for you. This is the only file currently different than what’s here on the repository.

    If you can test it and let me know, or let me know if you are unable to test it, that would be helpful to me. Thank you!

    quantaweb

    (@quantaweb)

    Robin,

    My apologies for taking so long to reply. Christmas got in the way but now I’ve got my wheels back on the rails.

    I downloaded the output file and voila! — it did solve the issue.

    For what it’s worth, I haven’t coded special characters into the title; I just type them. I do use Yoast, which does some rewriting of the titles.

    I tested your new file with a number of posts and each title appeared exactly as expected.

    Thanks again! And Happy New Year!
    Denise

    Plugin Author Robin Cornett

    (@littlerchicken)

    Well, the holiday is slowing me down too for sure! Thank you for letting me know that it worked. I’ll include this in the next release of the plugin. Have a wonderful new year!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘turning special characters in the title into code.’ is closed to new replies.