# Ampersand (&) doesn't 'display' right if from linked post

**URL:** https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101
**Category:** Bug
**Created:** [2015 年4 月 2 日 07:46 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101 "2015-04-02T07:46:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![streger](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@streger](https://meta.discourse.org/u/streger)
#### Post date: [2015 年4 月 2 日 07:46 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101/1 "2015-04-02T07:46:16Z")

</div>

This is really a small bother, just one of those perfection things I guess 😊

So, if you make a post in some topic with ampersand (& char), like for example write: drag&drop; it will not display correctly if you use that post in some other topic as linked. It is displayed as html character, ‘&amp’

Discourse version: **v1.3.0.beta4 +59**  
Viewing in latest Chrome 41.

p.s. I would show you the pictures for example, but restrictions doesn’t allow.

---

<div class="post-metadata">

### Author: ![purezen\_](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@purezen\_](https://meta.discourse.org/u/purezen_)
#### Post date: [2015 年4 月 2 日 15:20 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101/2 "2015-04-02T15:20:33Z")

</div>

Hi guys,

I am keen to contribute to Discourse and would like to work on this bug.  
I have tried to reproduce the issue and it looks like Discourse appends `amp;` to the _first_ occurrence of `&` where a linked post is displayed.  
Would be glad if someone could suggest where to look for solving the same.

Cheers!

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [2015 年4 月 2 日 15:27 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101/3 "2015-04-02T15:27:29Z")

</div>

Have a look at these files:

```
vendor/assets/javascripts/better_markdown.js
app/assets/javascripts/discourse/lib/markdown.js
app/assets/javascripts/discourse/dialects/dialect.js

```

Yes, those are JavaScripts; Discourse embeds a JavaScript engine (see `lib/pretty_text.rb`) server-side to cook submitted posts instead of duplicating the code in Ruby or trusting the client to submit valid cooked HTML. 🙂

---

<div class="post-metadata">

### Author: ![streger](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@streger](https://meta.discourse.org/u/streger)
#### Post date: [2015 年4 月 2 日 17:51 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101/7 "2015-04-02T17:51:17Z")

</div>

Just to pop-up and thank you all for any reaction.  
Glad to see that this community has people interested in this open source forum.  
❤ ya all

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2017 年5 月 9 日 18:04 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101/9 "2017-05-09T18:04:15Z")

</div>

I am no longer able to repro this, closing

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2017 年5 月 9 日 18:04 UTC](https://meta.discourse.org/t/ampersand-doesnt-display-right-if-from-linked-post/27101/10 "2017-05-09T18:04:18Z")

</div>


