Table of Contents Plus
[resolved] Problems with apostrophes and quotation marks (6 posts)

  1. esandman
    Posted 3 years ago #

    I absolutely love this plugin. However, I've had problems with headers that feature apostrophes or quotation marks. The auto-generated URL doesn't work. I've had to remove the ' and " in order to make the anchor URL work. Has anyone else noticed this?


  2. Mike
    Plugin Author

    Posted 3 years ago #

    Works for me... has a '

    2.5 has "

    Got a link with the issue? Could be a copy/paste translation from elsewhere? After pasting into WordPress, try deleting the ' and " and inserting it manually with your keyboard.

  3. esandman
    Posted 3 years ago #

    Thanks Michael. This is an example of a link that's not working for me: http://www.electology.org/approval-voting#Doesnt_Approval_Voting_violate_one_person_one_vote

    You can see it under CONTENTS on the right side of the page.

  4. Mike
    Plugin Author

    Posted 3 years ago #

    Looks like wptexturize is applied to the content which converts characters like ' to &8217;. I've just updated the widget to do the same which means it will link to the correct anchor.

    Not sure when a new version will come out but if you want to apply the change now, edit toc.php and on line 1498, make it look like:

    $items = $tic->extract_headings( $find, $replace, wptexturize($post->post_content) );

  5. esandman
    Posted 3 years ago #

    Thanks, I did it but I got this message:

    This plugin has been deactivated because your changes resulted in a fatal error.

    Parse error: syntax error, unexpected '&' in /home/electolo/public_html/wp-content/plugins/table-of-contents-plus/toc.php on line 1498

  6. Mike
    Plugin Author

    Posted 3 years ago #

    Did you copy/paste the code I gave you? Try typing out the following bit:


    That was the only change.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Table of Contents Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic