libor-m/pagedown

Failure with multiple editors. Each instantiation overwrites the previous one.

Closed this issue · 2 comments

Example:

  var makeEditor = function(id) {
    var converter = Markdown.getSanitizingConverter();
    selectors = {
        input : id,
        button : id+"_wmd_button_bar",
        preview : id+"_wmd_preview",
    }
    return new Markdown.Editor(converter, "", selectors);
  };
  var editor1 = makeEditor('#textarea_a');
  var editor2 = makeEditor('#textarea_b');
  editor1.run();
  editor2.run();

This causes the editor to be placed twice on the second field, while ignoring 
the first one. The problem is an issue of scope. The variables for the 
selectors are not tied to the editor instances, but rather the function itself, 
causing each instantiation to overwrite the previous one.



Original issue reported on code.google.com by bendavi...@gmail.com on 25 Jul 2013 at 3:09

My apologies, please close this issue. I was unaware that I was using a fork of 
the project which is what produces the bug.

Original comment by bendavi...@gmail.com on 25 Jul 2013 at 3:27

Original comment by b...@stackoverflow.com on 11 Apr 2014 at 9:23

  • Changed state: Invalid