code: function () {
  
                      inputBox.focus();
  
                      if (chunks) {
                          state.setChunks(chunks);
                      }
  
                      state.restore();
                      previewManager.refresh();
                  }
docs: Some commands launch a "modal" prompt dialog.  Javascript can't really make a modal dialog box and the WMD code will continue to execute while the dialog is displayed. This prevents the dialog pattern I'm used to and means I can't do something like this:  var link = CreateLinkDialog(); makeMarkdownLink(link);  Instead of this straightforward method of handling a dialog I have to pass any code which would execute after the dialog is dismissed (e.g. link creation) in a function parameter.  Yes this is awkward and I think it sucks, but there's no real workaround.  Only the image and link code create dialogs and require the function pointers.