style: minor change in code doc

This commit is contained in:
yanglbme 2020-11-21 09:33:45 +08:00
parent 6645eb3cde
commit aee49b2d32
2 changed files with 10 additions and 1 deletions

View File

@ -188,6 +188,10 @@ export function saveEditorContent(editor, name) {
}
}
/**
* 格式化文档
* @param {文档内容} content
*/
export function formatDoc(content) {
const doc = prettier.format(content, {
parser: "markdown",
@ -196,6 +200,7 @@ export function formatDoc(content) {
return doc;
}
export function fixCodeWhiteSpace(value = "pre") {
const preDomList = document.getElementsByClassName("code__pre");
if (preDomList.length > 0) {
@ -205,6 +210,10 @@ export function fixCodeWhiteSpace(value = "pre") {
}
}
/**
* 下载原始 Markdown 文档
* @param {文档内容} doc
*/
export function downLoadMD(doc) {
let downLink = document.createElement("a");

View File

@ -313,8 +313,8 @@ export default {
setTimeout(() => {
this.cssEditor.refresh();
}, 50);
let flag = await localStorage.getItem("__css_content");
let flag = await localStorage.getItem("__css_content");
if (!flag) {
this.setCssEditorValue(DEFAULT_CSS_CONTENT);
}