4

Problem

This code,

![“Are you coming to bed? —I can’t. This is important. —What? —Someone is _wrong_ on the Internet.”](https://i.sstatic.net/nXAfo.png)

renders correctly in preview as an embedded image. But after posting it no longer renders correctly. Instead it renders as a text fragment:

wrong on the Internet.”">

Demonstration

Open the this post in the editor and see how the following code renders in the preview:

“Are you coming to bed? —I can’t. This is important. —What? —Someone is _wrong_ on the Internet.”

Workaround

Avoid the underline character. This code renders correctly after posting:

![“Are you coming to bed? —I can’t. This is important. —What? —Someone is -wrong- on the Internet.”](https://i.sstatic.net/nXAfo.png)

Discussion

I suppose underlines in the image description are mistaken for Markdown. In the image description they really should be taken as literals (or at least ignored); regardless, they should not cause the sort of rendering error shown above.

4
  • I guess it's strongly related to Link with double-underscored word in URL renders incorrectly and Fail of markdown parser detected if '_ 's are used in a naked URL (the latter being status-declined). Commented Feb 20, 2013 at 21:21
  • As an aside: I wonder if formatting in alt-text is ever useful? Commented Feb 20, 2013 at 21:23
  • Given that the code renders properly in preview, just not after post, I would hope this is a very easy fix rather than one that would be declined. Commented Feb 20, 2013 at 21:23
  • @Arjan Sure. On any of the programming sites, a variable name with underscore separation could be part of an alt-text. But from the links you supplied, I understand that this bug also affects URLs themselves, not just alt-text: surely underscores in URLs should not be misrendered. Commented Feb 20, 2013 at 21:28

1 Answer 1

2

The server-side Markdown version had two methods for creating image HTML, and only one of them handled this correctly. This version would have worked:

![“Are you coming to bed? —I can’t. This is important. —What? —Someone is _wrong_ on the Internet.”][1] [1]: https://i.sstatic.net/nXAfo.png 

The JavaScript implementation already handled both versions correctly, since it already combined the handling of both versions into one single method that did the right thing.

From the next build on, the server-side implementation does the same.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.