style: prettify code

This commit is contained in:
yanglbme 2020-11-21 01:34:46 +00:00 committed by GitHub Action
parent aee49b2d32
commit a54f55bbac
2 changed files with 16 additions and 17 deletions

View File

@ -11,11 +11,10 @@ import CodeMirror from "codemirror/lib/codemirror";
var Pos = CodeMirror.Pos;
CodeMirror.defineOption("autoCloseBrackets", false, function (
cm,
val,
old
) {
CodeMirror.defineOption(
"autoCloseBrackets",
false,
function (cm, val, old) {
if (old && old != CodeMirror.Init) {
cm.removeKeyMap(keyMap);
cm.state.closeBrackets = null;
@ -25,7 +24,8 @@ import CodeMirror from "codemirror/lib/codemirror";
cm.state.closeBrackets = val;
cm.addKeyMap(keyMap);
}
});
}
);
function getOption(conf, name) {
if (name == "pairs" && typeof conf == "string") return conf;

View File

@ -200,7 +200,6 @@ export function formatDoc(content) {
return doc;
}
export function fixCodeWhiteSpace(value = "pre") {
const preDomList = document.getElementsByClassName("code__pre");
if (preDomList.length > 0) {