# &hyphen; being rendered as hyphen in preview

**URL:** <https://meta.discourse.org/t/hyphen-being-rendered-as-hyphen-in-preview/61499>\
**Category:** Bug\
**Created:** [2017年四月24日 14:54 UTC](https://meta.discourse.org/t/hyphen-being-rendered-as-hyphen-in-preview/61499 "2017-04-24T14:54:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![burke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/burke/32/4211_2.png) [@burke](https://meta.discourse.org/u/burke)\
**Post date:** [2017年四月24日 14:54 UTC](https://meta.discourse.org/t/hyphen-being-rendered-as-hyphen-in-preview/61499/1 "2017-04-24T14:54:07Z")

</div>

This is a (sub-)trivial issue, but I stumbled upon the fact that then non-entity ‐ behaves differently in the post preview than in Discourse.

In a draft post:

```
check out this &hyphen;

```

Seen in the preview:

```
check out this -

```

Once submitted:

```
check out this &hyphen;

```

While it may be a convenient entity, I don’t believe `&hyphen;` is a standard HTML entity (most sites suggest `&#45;` if you need an entity for a hyphen), so the post preview should probably not be converting `&hyphen;` to a hyphen.

Just in case someone is really bored and looking for a “bug” to fix. Then again, the preview rendering may be handled by a separate library and them’s the breaks. 😉

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2017年四月24日 16:10 UTC](https://meta.discourse.org/t/hyphen-being-rendered-as-hyphen-in-preview/61499/2 "2017-04-24T16:10:55Z")

</div>

There is already a bug on this, as I recall it is deep in the bowels of the randomly Japanese named XML / HTML processor we are using. I can’t recall its name at the moment, perhaps @sam can.

Pick your poison

[https://meta.discourse.org/search?q=Nokogiri%20entities](https://meta.discourse.org/search?q=Nokogiri%20entities)

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年四月24日 16:13 UTC](https://meta.discourse.org/t/hyphen-being-rendered-as-hyphen-in-preview/61499/3 "2017-04-24T16:13:12Z")

</div>

IIRC it may be [nokogiri](http://www.nokogiri.org/)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2017年四月24日 16:13 UTC](https://meta.discourse.org/t/hyphen-being-rendered-as-hyphen-in-preview/61499/4 "2017-04-24T16:13:20Z")

</div>


