Skip to content

Fix Markdown preview not working in Edit Milestone page

What does this MR do?

This MR removes the automatic Zen Mode URL update when a hash is present and makes Markdown preview work again in the Edit Milestone page. I think the intent was to make it possible to link to a full-screen edit with a URL (e.g. http://foo/bar/issues/1/edit#fullscreen), but I don't this has ever worked. Perhaps a future MR can support this.

Why was this MR needed?

A JavaScript error would be seen in the Milestone Edit page:

Uncaught error, unrecognized expression: $('.zennable input[type=checkbox]##md-preview-holder')

In the Milestone Edit page, apparently the use of the hash #md-preview-holder causes the Zen Mode JavaScript to attempt to parse the hash for the fullscreen_ prefix and look up the checkbox based on a unknown ID.

Are there points in the code the reviewer needs to double check?

If we want to keep this hash update, an alternative fix is to add an if check in the beginning of checkboxFromLocationHash:

if (window.location.hash.indexOf('#' + ZenMode.fullscreen_prefix) == -1) 
  return null

What are the relevant issue numbers?

Merge request reports