mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
style: minor change in code doc
This commit is contained in:
parent
6645eb3cde
commit
aee49b2d32
@ -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");
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user