2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-03 08:04:29 -06:00

improve get state, add public getter

This commit is contained in:
Adam Misiorny 2016-01-20 21:50:59 +01:00
parent 7aedb8623a
commit 62caea601e

View File

@ -166,6 +166,12 @@ function getState(cm, pos) {
ret.strikethrough = true; ret.strikethrough = true;
} else if(data === "comment") { } else if(data === "comment") {
ret.code = true; 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; return ret;
@ -1545,4 +1551,10 @@ SimpleMDE.prototype.isFullscreenActive = function() {
return cm.getOption("fullScreen"); return cm.getOption("fullScreen");
}; };
SimpleMDE.prototype.getState = function() {
var cm = this.codemirror;
return getState(cm);
};
module.exports = SimpleMDE; module.exports = SimpleMDE;