bastianallgeier/kirbycms — pull request #105 by Zegnat (2014-03-06 09:18:24+00:00)
Title: Preserve existing HTML entities.

This patch changes the way `str::html` handles ampersands (`&`) and with that updates Kirbytext to preserve HTML entities, fixing problems such as #104.

This patch adapts the Ampersand-encoding regular expression from PHP Markdown (“based entirely on [Nat Irons’s Amputator](http://bumppo.net/projects/amputator/)”) but flips it around: decoding `&`s wrongfully encoded by PHP’s `htmlentities`.

Note that this further distances the `kirby.php` file shipped with Kirby from the [Kirby Toolkit](https://github.com/bastianallgeier/kirby). This changes the `str::html` without regard for bastianallgeier/kirby#31, specifically to not change the [PHP requirements of Kirby](http://getkirby.com/hosting) from 5.2+ to 5.3+.