[pmwiki-users] single quotes and ToggleLink

Hans design5 at softflow.co.uk
Thu Mar 27 07:49:59 CDT 2008

It is a little strange that the php function
   htmlspecialchars($string, ENT_QUOTES);
does not help here. An apostrophe ' is converted to '
and this does not work for the javascript.
It needs to be a ’ which is really a right single quotation
mark. There is no other than the numeric code ' for the apostrophe.

If you want to make it transparent for users you could modify the
toggle script and  add ca line 75 somewhere soon after line
   $opt = array_merge($defaults, ParseArgs($opt));
   $opt['lshow'] = str_replace("'","’",$opt['lshow']);
   $opt['lhide'] = str_replace("'","’",$opt['lhide']);

Then you can write in the wiki page toggle markup strings like
  lshow="foo's right single quotes"
and the ' gets converted fine. Use the double quotes to wrap the
whole string.


More information about the pmwiki-users mailing list