mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-23 16:00:11 +02:00
Merge pull request #229 from adam187/feature/get-state
Improve get state
This commit is contained in:
commit
91a27e314a
|
@ -166,6 +166,12 @@ function getState(cm, pos) {
|
|||
ret.strikethrough = true;
|
||||
} else if(data === "comment") {
|
||||
ret.code = true;
|
||||
} else if(data === "link") {
|
||||
ret.link = true;
|
||||
} else if(data === "tag") {
|
||||
ret.image = true;
|
||||
} else if(data.match(/^header(\-[1-6])?$/)) {
|
||||
ret[data.replace("header", "heading")] = true;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -1545,4 +1551,10 @@ SimpleMDE.prototype.isFullscreenActive = function() {
|
|||
return cm.getOption("fullScreen");
|
||||
};
|
||||
|
||||
SimpleMDE.prototype.getState = function() {
|
||||
var cm = this.codemirror;
|
||||
|
||||
return getState(cm);
|
||||
};
|
||||
|
||||
module.exports = SimpleMDE;
|
||||
|
|
Loading…
Reference in a new issue