Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the Markdown content and put on the textarea to reedit? #58

Closed
sunorry opened this issue Sep 16, 2014 · 3 comments
Closed

Get the Markdown content and put on the textarea to reedit? #58

sunorry opened this issue Sep 16, 2014 · 3 comments

Comments

@sunorry
Copy link

sunorry commented Sep 16, 2014

I want ro reedit the content . so

  1. Get the content (that be published)
var value = editor.codemirror.getValue(); // the value that be Markdown fommat content
  1. put the value to the textarea ,try to 2 ways , but failed
    1. $('.CodeMirror-scroll').text(value);
    2. $('.CodeMirror-scroll').html(value);

That's a bug?

@cben
Copy link

cben commented Sep 16, 2014

I don’t think .CodeMirror-scroll gives you a textarea, I think it’s part of the DOM hierarchy created by CM.
Since the editor was created with CodeMirror.fromTextArea(), try editor.codemirror.save() to update it?
http://codemirror.net/doc/manual.html#fromTextArea

@sunorry
Copy link
Author

sunorry commented Sep 16, 2014

@cben I mean I want to get the published blog , then reedit it . So I need to put the content to textarea or some area(I don't konw put the content to where).

@lepture
Copy link
Owner

lepture commented Nov 5, 2014

@sunorry I've added a method: .value for getting and setting value. 6348fd9

@lepture lepture closed this as completed Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants