Tip: Adding support for utf-8 entities

5 views
Skip to first unread message

Henrik Bechmann

unread,
Aug 25, 2013, 7:30:59 PM8/25/13
to simpl...@googlegroups.com
To add support for utf-8 entities (like ✓ = a checkmark), do the following:

configure your instance of simplewiki like this:

$simplewiki->register_charfilter_handler(array($this,'process_htmlentities'));

Then define the charfilter handler thus:

public function process_htmlentities($text,$node) // not using $node parameters
{
 
return htmlentities(html_entity_decode($text,ENT_COMPAT | ENT_HTML401,'UTF-8'),ENT_COMPAT | ENT_HTML401,'UTF-8');// allow html entities
}

- Henrik


Henrik Bechmann

unread,
Aug 25, 2013, 7:33:18 PM8/25/13
to simpl...@googlegroups.com
...then of course your authors can just type entities straight into the markup code...
Reply all
Reply to author
Forward
0 new messages