feat:1、修复无数据时报错的问题。

2、新增自定义代码着色格式
3、新增自动加载配置文件
This commit is contained in:
lifei6671
2018-08-07 17:19:56 +08:00
parent c0c3db6c50
commit 327d6fb8d8
280 changed files with 162 additions and 98 deletions

View File

@@ -36,18 +36,6 @@
.editormd-preview-container table tr {
background-color: #fff
}
.editormd-preview-container code {
padding: .2em 0;
margin-left: 3px;
margin-right: 3px;
background-color: #eee;
border-radius: 3px;
font-size: 1em;
font-family: Consolas,"Liberation Mono",Menlo,Courier,'Microsoft Yahei',monospace;
border: 0;
color: #555;
word-break: break-all;
}
/**************TOC*******************/
.markdown-toc{
@@ -56,17 +44,35 @@
}
/***********代码样式*****************/
.markdown-body .highlight pre, .markdown-body pre{
padding: 0;
font-size: 12px;
border-radius:0;
line-height: 1.4em;
padding: 1em;
border: none;
overflow: auto;
line-height: 1.45;
max-height: 35em;
position: relative;
/*background: url(../editor.md/lib/highlight/blueprint.png) #F6F6F6;*/
-moz-background-size: 30px,30px;
-o-background-size: 30px,30px;
-webkit-background-size: 30px,30px;
background-size: 30px,30px;
border-radius:4px;
word-break:break-all;
word-wrap:break-word;
}
.editormd-preview-container pre.hljs>code {
border-radius: 3px;
font-size: 1.1em;
font-family: "Source Code Pro",Consolas,"Liberation Mono",Menlo,Courier,'Microsoft Yahei',monospace;
border: 0;
word-break: break-all;
overflow-y: auto; overflow-x: hidden;
overflow-wrap: normal;
white-space: inherit
}
.editormd-preview-container pre.prettyprint, .editormd-html-preview pre.prettyprint {
padding: 0;
}
.hljs{
padding: 10px 15px !important;
}
.editormd-preview-container ol.linenums, .editormd-html-preview ol.linenums{
color: #999;
}

View File

@@ -3636,7 +3636,6 @@
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
@@ -3657,7 +3656,6 @@
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
@@ -3865,7 +3863,6 @@
}
.editormd-preview-container pre, .editormd-html-preview pre {
border: 1px solid #ddd;
background: #f6f6f6;
padding: 10px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;

View File

@@ -2920,7 +2920,6 @@
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
@@ -2941,7 +2940,6 @@
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
@@ -3149,7 +3147,6 @@
}
.editormd-preview-container pre, .editormd-html-preview pre {
border: 1px solid #ddd;
background: #f6f6f6;
padding: 10px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;

View File

@@ -26,7 +26,9 @@
var cmAddonPath = "codemirror/addon/";
var codeMirrorModules = [
"jquery", "marked", "prettify",
"jquery", "marked",
//"prettify",
"highlight/highlight",
"katex", "raphael", "underscore", "flowchart", "jqueryflowchart", "sequenceDiagram",
"codemirror/lib/codemirror",
@@ -239,6 +241,7 @@
flowChart : false, // flowChart.js only support IE9+
sequenceDiagram : false, // sequenceDiagram.js only support IE9+
previewCodeHighlight : true,
highlightStyle : "github",
toolbar : true, // show/hide toolbar
toolbarAutoFixed : true, // on window scroll auto fixed position
@@ -653,7 +656,10 @@
if (settings.previewCodeHighlight)
{
editormd.loadScript(loadPath + "prettify.min", function() {
// editormd.loadScript(loadPath + "prettify.min", function() {
// loadFlowChartOrSequenceDiagram();
// });
editormd.loadScript(loadPath + "highlight/highlight", function() {
loadFlowChartOrSequenceDiagram();
});
}
@@ -1543,11 +1549,16 @@
if (settings.previewCodeHighlight)
{
previewContainer.find("pre").addClass("prettyprint linenums");
if (typeof prettyPrint !== "undefined")
{
prettyPrint();
// previewContainer.find("pre").addClass("prettyprint");
//
// if (typeof prettyPrint !== "undefined")
// {
// prettyPrint();
// }
if (typeof hljs !== "undefined") {
previewContainer.find('pre').each(function (i, block) {
hljs.highlightBlock(block);
});
}
}
@@ -4064,8 +4075,11 @@
if (settings.previewCodeHighlight)
{
div.find("pre").addClass("prettyprint linenums");
prettyPrint();
//div.find("pre").addClass("prettyprint");
//prettyPrint();
div.find("pre").each(function (i, block) {
hljs.highlightBlock(block);
});
}
if (!editormd.isIE8)

View File

@@ -580,10 +580,14 @@
editormd.loadScript(loadPath + "marked.min", function() {
editormd.$marked = marked;
if(!settings.highlightStyle){
settings.highlightStyle = "github";
}
if (settings.previewCodeHighlight)
{
editormd.loadScript(loadPath + "prettify.min", function() {
editormd.loadCSS(loadPath + "highlight/styles/" + settings.highlightStyle);
editormd.loadScript(loadPath + "highlight/highlight", function() {
loadFlowChartOrSequenceDiagram();
});
}
@@ -1473,12 +1477,15 @@
if (settings.previewCodeHighlight)
{
previewContainer.find("pre").addClass("prettyprint linenums");
if (typeof prettyPrint !== "undefined")
{
prettyPrint();
}
// previewContainer.find("pre").addClass("prettyprint");
//
// if (typeof prettyPrint !== "undefined")
// {
// prettyPrint();
// }
previewContainer.find("pre").each(function (i, block) {
hljs.highlightBlock(block);
});
}
return this;
@@ -3994,7 +4001,7 @@
if (settings.previewCodeHighlight)
{
div.find("pre").addClass("prettyprint linenums");
div.find("pre").addClass("prettyprint");
prettyPrint();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Some files were not shown because too many files have changed in this diff Show More