Expanding onebox with linked Discourse article causes HTML characters to be displayed

AI-generated summary

A bug has been reported in Discourse where expanding a linked article with a onebox causes HTML characters (> and <) to be displayed. To reproduce the issue:

  1. Create a topic with a > or < symbol in the first few lines.
  2. Create another topic and link the original topic.
  3. Onebox the original topic.
  4. Expand the article by clicking the down arrow.

@wesochuck has provided screenshots demonstrating the issue and has offered to reproduce it on try.discourse.org. A fix for the bug has been committed by @eviltrout and is available on GitHub.

Just repod this on try.discourse.org

  1. Create an topic that has a > (greater than) symbol in the first few lines of text
  2. Create another topic and link the original topic in step 1
  3. This will onebox the original topic in topic #2
  4. Click the down arrow in topic #2 to expand the article

The first > will get rendered as a &gt; the same thing will happen if you used a < (less than symbol).

Expanded the article by clicking the down arrow (notice the &gt; after the word One):

2 « J'aime »

What’s up with these screenshots?

Glad I’m not the only one here. Dimmed into the background? Same from my view too.

Sorry I can retake if needed. That’s my 1am F.lux plus background dimming program I use when I can’t get to sleep.

Do you need me to repo again on try?

2 « J'aime »

Yeah please :smile: :wink:

Enjoy the f.lux free versions:

Here’s a fix:

https://github.com/discourse/discourse/commit/9c882795c3197542b1ec669c327f5cac77e99a68

4 « J'aime »