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

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

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.

3 Likes

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!

1 Like

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. :slight_smile:

1 Like

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.
:heart: ya all

1 Like

I am no longer able to repro this, closing

1 Like