17

The image upload and hyperlink tools in the markdown toolbar don't seem to be uploading images/posting link markdown until something is entered into the text editor.

The failure for the image uploader provides an error in the console:

wmd.en.js?v=ad7be89b32b9:1 Uncaught Error: Markdown renderer is not initialized

Error provided by rene in the Tavern.

There's no front-facing error message, the upload succeeds, but the markdown generation fails entirely.

Performing this using the hyperlink tool tries to post the question, and tells the user that text is required before posting, and the question review process errors out (which is correct behavior if I was actually trying to post the question,) here's a .gif of me performing this.

Once text is entered manually (even if it is subsequently deleted) the image upload and hyperlink tools work again.

This appears to be related to the CommonMark migration that's recently started, as it occurs on Movies&TV, which has recently migrated to CommonMark. It works perfectly fine on Stack Overflow, which has yet to migrate to CommonMark.

Could this be fixed?

  • 2
    Confirmed on Movies & TV. The image uploaded but never rendered in the post. – Mark Kirby Jun 4 at 20:27
  • 1
    Also stlll works fine on Teams. And the upload to Imgur succeeds. The POST to meta.stackexchange.com/upload/image?method=json&https=true returns 200 OK with a valid JSON response and the image url. – rene Jun 4 at 20:28
  • @rene did they already switch to the new markdown engine here? Is this bug due to it? – Shadow Wizard Wearing Mask Jun 4 at 20:54
  • @ShadowKeepsSocialDistance yes, it is the new engine causing it. – rene Jun 4 at 21:17
  • 2
    Good catch, this looks like it's caused by the new CommonMark renderer. I'll get a fix out right away. Sorry for the hassle! – Ham Vocke Jun 5 at 6:32
  • 2
    To unblock anyone annoyed by this: start typing some text into the text box first before inserting links or images. That will load the Markdown renderer properly and you can continue as usual. Got a local repro and am working on a proper fix now. – Ham Vocke Jun 5 at 7:38
9

Thanks for reporting. This is a side-effect of the changes introduced by switching to CommonMark.

A fix has just been deployed to meta and will go out to all sites in a few minutes. The issue should be resolved now.


Details for the curious:

In order to support CommonMark we had to include a new markdown renderer in our editor. The new markdown renderer is being loaded lazily - only once you really start typing stuff into the editor, we're going to fetch the source code for the new markdown renderer from the server. This way, we can drastically reduce the amount of data we have to send to most page views where an editor is included but a user won't actually write stuff. Unfortunately, the image/link insertion dialogs made some calls to our markdown renderer before it was properly loaded and I had missed those edge cases initially.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .