Title: Settings &gt; Formatting fields display HTML special characters wrong
Last modified: August 20, 2016

---

# Settings > Formatting fields display HTML special characters wrong

 *  Resolved [Daedalon](https://wordpress.org/support/users/daedalon/)
 * (@daedalon)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/settings-formatting-fields-display-html-special-characters-wrong/)
 * When editing the formatting of for example the Single Location page and typing“&
   nbsp;” (without the space) for a non-breaking space, it gets saved in the database
   correctly, but when viewing the page again, it is shown in the editor as a regular
   space. Thus if you edit a different part of the setting field and save it, it
   is now saved into db as a regular space.
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/settings-formatting-fields-display-html-special-characters-wrong/#post-3242191)
 * not sure there’s much we can do about that… if we try to convert the & then it’ll
   convert everything including the html tags.
 *  Thread Starter [Daedalon](https://wordpress.org/support/users/daedalon/)
 * (@daedalon)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/settings-formatting-fields-display-html-special-characters-wrong/#post-3242192)
 * Depending on how the conversion is currently done, one way is to double-encode
   every “& nbsp;” (without the space) before the display. Perhaps extend it to 
   all “& something;” (without the space) special chars.
 * Something like `$text = preg_replace( '_&([A-Za-z0-9#]+;)_', '& amp;$1', $text);`(
   without the space after “&”) should do the trick.
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/settings-formatting-fields-display-html-special-characters-wrong/#post-3242202)
 * could look into that in the future but there’s other implications with that. 
   For now I suggest you hook into the wp filter option_dbem…. for the options you
   need this on and apply this to the options you want to add this to.
 * if we add this for “& amp;” then the next request will be for some other entity
   🙂
 *  Thread Starter [Daedalon](https://wordpress.org/support/users/daedalon/)
 * (@daedalon)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/settings-formatting-fields-display-html-special-characters-wrong/#post-3242203)
 * > if we add this for “& amp;” then the next request will be for some other entity
   > 🙂
 * For this I suggested doing it for all entities at once with the _preg\_replace_
   above. Requires testing, though.
 * Will look into that filter, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Settings > Formatting fields display HTML special characters wrong’ is
closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Daedalon](https://wordpress.org/support/users/daedalon/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/settings-formatting-fields-display-html-special-characters-wrong/#post-3242203)
 * Status: resolved