2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-02 23:54:28 -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;
} 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;