mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-06-28 15:45:35 +08:00
feat:1、修复无数据时报错的问题。
2、新增自定义代码着色格式 3、新增自动加载配置文件
This commit is contained in:
parent
c0c3db6c50
commit
327d6fb8d8
@ -43,7 +43,7 @@ func RegisterDataBase() {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
orm.DefaultTimeLoc = location
|
orm.DefaultTimeLoc = location
|
||||||
} else {
|
} else {
|
||||||
beego.Error("加载时区配置信息失败,请检查是否存在ZONEINFO环境变量:", err)
|
beego.Error("加载时区配置信息失败,请检查是否存在ZONEINFO环境变量->", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
port := beego.AppConfig.String("db_port")
|
port := beego.AppConfig.String("db_port")
|
||||||
@ -51,7 +51,7 @@ func RegisterDataBase() {
|
|||||||
dataSource := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=true&loc=%s", username, password, host, port, database, url.QueryEscape(timezone))
|
dataSource := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=true&loc=%s", username, password, host, port, database, url.QueryEscape(timezone))
|
||||||
|
|
||||||
if err := orm.RegisterDataBase("default", "mysql", dataSource); err != nil {
|
if err := orm.RegisterDataBase("default", "mysql", dataSource); err != nil {
|
||||||
beego.Error("注册默认数据库失败:", err)
|
beego.Error("注册默认数据库失败->", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
} else if adapter == "sqlite3" {
|
} else if adapter == "sqlite3" {
|
||||||
@ -67,7 +67,7 @@ func RegisterDataBase() {
|
|||||||
err := orm.RegisterDataBase("default", "sqlite3", database)
|
err := orm.RegisterDataBase("default", "sqlite3", database)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
beego.Error("注册默认数据库失败:", err)
|
beego.Error("注册默认数据库失败->", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
beego.Error("不支持的数据库类型.")
|
beego.Error("不支持的数据库类型.")
|
||||||
@ -252,6 +252,7 @@ func ResolveCommand(args []string) {
|
|||||||
if err := beego.LoadAppConfig("ini", conf.ConfigurationFile);err != nil {
|
if err := beego.LoadAppConfig("ini", conf.ConfigurationFile);err != nil {
|
||||||
log.Fatal("An error occurred:", err)
|
log.Fatal("An error occurred:", err)
|
||||||
}
|
}
|
||||||
|
conf.AutoLoadDelay = beego.AppConfig.DefaultInt("config_auto_delay",0)
|
||||||
uploads := conf.WorkingDir("uploads")
|
uploads := conf.WorkingDir("uploads")
|
||||||
|
|
||||||
os.MkdirAll(uploads, 0666)
|
os.MkdirAll(uploads, 0666)
|
||||||
@ -374,6 +375,40 @@ func RegisterCache() {
|
|||||||
beego.Info("缓存初始化完成.")
|
beego.Info("缓存初始化完成.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//自动加载配置文件.修改了监听端口号和数据库配置无法自动生效.
|
||||||
|
func RegisterAutoLoadConfig() {
|
||||||
|
if conf.AutoLoadDelay > 0 {
|
||||||
|
ticker := time.NewTicker(time.Second * time.Duration(conf.AutoLoadDelay))
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
f,err := os.Stat(conf.ConfigurationFile)
|
||||||
|
if err != nil {
|
||||||
|
beego.Error("读取配置文件时出错 ->",err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
modTime := f.ModTime()
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-ticker.C:
|
||||||
|
f,err := os.Stat(conf.ConfigurationFile)
|
||||||
|
if err != nil {
|
||||||
|
beego.Error("读取配置文件时出错 ->",err)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if modTime != f.ModTime() {
|
||||||
|
if err := beego.LoadAppConfig("ini", conf.ConfigurationFile); err != nil {
|
||||||
|
beego.Error("An error occurred:", err)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
modTime = f.ModTime()
|
||||||
|
beego.Info("配置文件已加载")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
||||||
if configPath, err := filepath.Abs(conf.ConfigurationFile); err == nil {
|
if configPath, err := filepath.Abs(conf.ConfigurationFile); err == nil {
|
||||||
|
@ -47,6 +47,8 @@ func (d *Daemon) Run() {
|
|||||||
|
|
||||||
commands.RegisterFunction()
|
commands.RegisterFunction()
|
||||||
|
|
||||||
|
commands.RegisterAutoLoadConfig()
|
||||||
|
|
||||||
beego.ErrorController(&controllers.ErrorController{})
|
beego.ErrorController(&controllers.ErrorController{})
|
||||||
|
|
||||||
fmt.Printf("MinDoc version => %s\nbuild time => %s\nstart directory => %s\n%s\n", conf.VERSION, conf.BUILD_TIME, os.Args[0], conf.GO_VERSION)
|
fmt.Printf("MinDoc version => %s\nbuild time => %s\nstart directory => %s\n%s\n", conf.VERSION, conf.BUILD_TIME, os.Args[0], conf.GO_VERSION)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
appname = godoc
|
appname = mindoc
|
||||||
# httpaddr = 127.0.0.1
|
# httpaddr = 127.0.0.1
|
||||||
httpport = 8181
|
httpport = 8181
|
||||||
runmode = dev
|
runmode = dev
|
||||||
@ -10,6 +10,15 @@ baseurl=
|
|||||||
#默认Session生成Key的秘钥
|
#默认Session生成Key的秘钥
|
||||||
beegoserversessionkey=123456
|
beegoserversessionkey=123456
|
||||||
|
|
||||||
|
#########代码高亮样式################
|
||||||
|
#样式演示地址:https://highlightjs.org/static/demo/
|
||||||
|
highlight_style=github
|
||||||
|
|
||||||
|
########配置文件自动加载##################
|
||||||
|
#大于0时系统会自动检测配置文件是否变动,变动后自动加载并生效,单位是秒。监听端口和数据库配置无效
|
||||||
|
config_auto_delay=0
|
||||||
|
|
||||||
|
|
||||||
########Session储存方式##############
|
########Session储存方式##############
|
||||||
#以文件方式储存
|
#以文件方式储存
|
||||||
sessionprovider=file
|
sessionprovider=file
|
||||||
|
@ -68,6 +68,7 @@ var (
|
|||||||
WorkingDirectory = "./"
|
WorkingDirectory = "./"
|
||||||
LogFile = "./runtime/logs"
|
LogFile = "./runtime/logs"
|
||||||
BaseUrl = ""
|
BaseUrl = ""
|
||||||
|
AutoLoadDelay = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
// app_key
|
// app_key
|
||||||
|
@ -77,6 +77,7 @@ func (c *BaseController) Prepare() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c.Data["HighlightStyle"] = beego.AppConfig.DefaultString("highlight_style","github")
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetMember 获取或设置当前登录用户信息,如果 MemberId 小于 0 则标识删除 Session
|
// SetMember 获取或设置当前登录用户信息,如果 MemberId 小于 0 则标识删除 Session
|
||||||
|
@ -44,18 +44,18 @@ func (c *LabelController) Index() {
|
|||||||
c.Abort("500")
|
c.Abort("500")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
member_id := 0
|
memberId := 0
|
||||||
if c.Member != nil {
|
if c.Member != nil {
|
||||||
member_id = c.Member.MemberId
|
memberId = c.Member.MemberId
|
||||||
}
|
}
|
||||||
searchResult, totalCount, err := models.NewBook().FindForLabelToPager(labelName, pageIndex, conf.PageSize, member_id)
|
searchResult, totalCount, err := models.NewBook().FindForLabelToPager(labelName, pageIndex, conf.PageSize, memberId)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil && err != orm.ErrNoRows {
|
||||||
beego.Error(err)
|
beego.Error("查询标签时出错 ->", err)
|
||||||
return
|
c.ShowErrorPage(500, "查询文档列表时出错")
|
||||||
}
|
}
|
||||||
if totalCount > 0 {
|
if totalCount > 0 {
|
||||||
pager := pagination.NewPagination(c.Ctx.Request, totalCount, conf.PageSize,c.BaseUrl())
|
pager := pagination.NewPagination(c.Ctx.Request, totalCount, conf.PageSize, c.BaseUrl())
|
||||||
c.Data["PageHtml"] = pager.HtmlPages()
|
c.Data["PageHtml"] = pager.HtmlPages()
|
||||||
} else {
|
} else {
|
||||||
c.Data["PageHtml"] = ""
|
c.Data["PageHtml"] = ""
|
||||||
@ -74,8 +74,8 @@ func (c *LabelController) List() {
|
|||||||
|
|
||||||
labels, totalCount, err := models.NewLabel().FindToPager(pageIndex, pageSize)
|
labels, totalCount, err := models.NewLabel().FindToPager(pageIndex, pageSize)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil && err != orm.ErrNoRows {
|
||||||
c.ShowErrorPage(50001, err.Error())
|
c.ShowErrorPage(500, err.Error())
|
||||||
}
|
}
|
||||||
if totalCount > 0 {
|
if totalCount > 0 {
|
||||||
pager := pagination.NewPagination(c.Ctx.Request, totalCount, conf.PageSize, c.BaseUrl())
|
pager := pagination.NewPagination(c.Ctx.Request, totalCount, conf.PageSize, c.BaseUrl())
|
||||||
|
@ -108,6 +108,10 @@ func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*Attachm
|
|||||||
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-attachment_id").Offset(offset).Limit(pageSize).All(&list)
|
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-attachment_id").Offset(offset).Limit(pageSize).All(&list)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == orm.ErrNoRows {
|
||||||
|
beego.Info("没有查到附件 ->",err)
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,9 +180,9 @@ func (m *Document) RemoveCache() {
|
|||||||
func (m *Document) FromCacheById(id int) (*Document, error) {
|
func (m *Document) FromCacheById(id int) (*Document, error) {
|
||||||
|
|
||||||
var doc Document
|
var doc Document
|
||||||
if err := cache.Get("Document.Id."+strconv.Itoa(id), &m); err == nil {
|
if err := cache.Get("Document.Id."+strconv.Itoa(id), &m); err == nil && m.DocumentId > 0 {
|
||||||
m = &doc
|
m = &doc
|
||||||
beego.Info("从缓存中获取文档信息成功", m.DocumentId)
|
beego.Info("从缓存中获取文档信息成功 ->", m.DocumentId)
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,8 +202,8 @@ func (m *Document) FromCacheByIdentify(identify string, bookId int) (*Document,
|
|||||||
|
|
||||||
key := fmt.Sprintf("Document.BookId.%d.Identify.%s", bookId, identify)
|
key := fmt.Sprintf("Document.BookId.%d.Identify.%s", bookId, identify)
|
||||||
|
|
||||||
if err := cache.Get(key,m); err == nil {
|
if err := cache.Get(key,m); err == nil && m.DocumentId > 0 {
|
||||||
beego.Info("从缓存中获取文档信息成功", key)
|
beego.Info("从缓存中获取文档信息成功 ->", key)
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/astaxie/beego/orm"
|
"github.com/astaxie/beego/orm"
|
||||||
"github.com/lifei6671/mindoc/conf"
|
"github.com/lifei6671/mindoc/conf"
|
||||||
"strings"
|
"strings"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Label struct {
|
type Label struct {
|
||||||
@ -98,6 +99,11 @@ func (m *Label) FindToPager(pageIndex, pageSize int) (labels []*Label, totalCoun
|
|||||||
|
|
||||||
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-book_number").Offset(offset).Limit(pageSize).All(&labels)
|
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-book_number").Offset(offset).Limit(pageSize).All(&labels)
|
||||||
|
|
||||||
|
if err == orm.ErrNoRows {
|
||||||
|
beego.Info("没有查询到标签 ->",err)
|
||||||
|
err = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,18 +36,6 @@
|
|||||||
.editormd-preview-container table tr {
|
.editormd-preview-container table tr {
|
||||||
background-color: #fff
|
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*******************/
|
/**************TOC*******************/
|
||||||
.markdown-toc{
|
.markdown-toc{
|
||||||
@ -56,17 +44,35 @@
|
|||||||
}
|
}
|
||||||
/***********代码样式*****************/
|
/***********代码样式*****************/
|
||||||
.markdown-body .highlight pre, .markdown-body pre{
|
.markdown-body .highlight pre, .markdown-body pre{
|
||||||
padding: 0;
|
padding: 1em;
|
||||||
font-size: 12px;
|
border: none;
|
||||||
border-radius:0;
|
overflow: auto;
|
||||||
line-height: 1.4em;
|
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 {
|
.editormd-preview-container pre.prettyprint, .editormd-html-preview pre.prettyprint {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.hljs{
|
|
||||||
padding: 10px 15px !important;
|
|
||||||
}
|
|
||||||
.editormd-preview-container ol.linenums, .editormd-html-preview ol.linenums{
|
.editormd-preview-container ol.linenums, .editormd-html-preview ol.linenums{
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
@ -3636,7 +3636,6 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
background-color: #f7f7f7;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3657,7 +3656,6 @@
|
|||||||
overflow: initial;
|
overflow: initial;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
background-color: transparent;
|
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3865,7 +3863,6 @@
|
|||||||
}
|
}
|
||||||
.editormd-preview-container pre, .editormd-html-preview pre {
|
.editormd-preview-container pre, .editormd-html-preview pre {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
background: #f6f6f6;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
-webkit-border-radius: 3px;
|
-webkit-border-radius: 3px;
|
||||||
-moz-border-radius: 3px;
|
-moz-border-radius: 3px;
|
||||||
|
@ -2920,7 +2920,6 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
background-color: #f7f7f7;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2941,7 +2940,6 @@
|
|||||||
overflow: initial;
|
overflow: initial;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
background-color: transparent;
|
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3149,7 +3147,6 @@
|
|||||||
}
|
}
|
||||||
.editormd-preview-container pre, .editormd-html-preview pre {
|
.editormd-preview-container pre, .editormd-html-preview pre {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
background: #f6f6f6;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
-webkit-border-radius: 3px;
|
-webkit-border-radius: 3px;
|
||||||
-moz-border-radius: 3px;
|
-moz-border-radius: 3px;
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
var cmAddonPath = "codemirror/addon/";
|
var cmAddonPath = "codemirror/addon/";
|
||||||
|
|
||||||
var codeMirrorModules = [
|
var codeMirrorModules = [
|
||||||
"jquery", "marked", "prettify",
|
"jquery", "marked",
|
||||||
|
//"prettify",
|
||||||
|
"highlight/highlight",
|
||||||
"katex", "raphael", "underscore", "flowchart", "jqueryflowchart", "sequenceDiagram",
|
"katex", "raphael", "underscore", "flowchart", "jqueryflowchart", "sequenceDiagram",
|
||||||
|
|
||||||
"codemirror/lib/codemirror",
|
"codemirror/lib/codemirror",
|
||||||
@ -239,6 +241,7 @@
|
|||||||
flowChart : false, // flowChart.js only support IE9+
|
flowChart : false, // flowChart.js only support IE9+
|
||||||
sequenceDiagram : false, // sequenceDiagram.js only support IE9+
|
sequenceDiagram : false, // sequenceDiagram.js only support IE9+
|
||||||
previewCodeHighlight : true,
|
previewCodeHighlight : true,
|
||||||
|
highlightStyle : "github",
|
||||||
|
|
||||||
toolbar : true, // show/hide toolbar
|
toolbar : true, // show/hide toolbar
|
||||||
toolbarAutoFixed : true, // on window scroll auto fixed position
|
toolbarAutoFixed : true, // on window scroll auto fixed position
|
||||||
@ -653,7 +656,10 @@
|
|||||||
|
|
||||||
if (settings.previewCodeHighlight)
|
if (settings.previewCodeHighlight)
|
||||||
{
|
{
|
||||||
editormd.loadScript(loadPath + "prettify.min", function() {
|
// editormd.loadScript(loadPath + "prettify.min", function() {
|
||||||
|
// loadFlowChartOrSequenceDiagram();
|
||||||
|
// });
|
||||||
|
editormd.loadScript(loadPath + "highlight/highlight", function() {
|
||||||
loadFlowChartOrSequenceDiagram();
|
loadFlowChartOrSequenceDiagram();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1543,11 +1549,16 @@
|
|||||||
|
|
||||||
if (settings.previewCodeHighlight)
|
if (settings.previewCodeHighlight)
|
||||||
{
|
{
|
||||||
previewContainer.find("pre").addClass("prettyprint linenums");
|
// previewContainer.find("pre").addClass("prettyprint");
|
||||||
|
//
|
||||||
if (typeof prettyPrint !== "undefined")
|
// if (typeof prettyPrint !== "undefined")
|
||||||
{
|
// {
|
||||||
prettyPrint();
|
// prettyPrint();
|
||||||
|
// }
|
||||||
|
if (typeof hljs !== "undefined") {
|
||||||
|
previewContainer.find('pre').each(function (i, block) {
|
||||||
|
hljs.highlightBlock(block);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4064,8 +4075,11 @@
|
|||||||
|
|
||||||
if (settings.previewCodeHighlight)
|
if (settings.previewCodeHighlight)
|
||||||
{
|
{
|
||||||
div.find("pre").addClass("prettyprint linenums");
|
//div.find("pre").addClass("prettyprint");
|
||||||
prettyPrint();
|
//prettyPrint();
|
||||||
|
div.find("pre").each(function (i, block) {
|
||||||
|
hljs.highlightBlock(block);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!editormd.isIE8)
|
if (!editormd.isIE8)
|
||||||
|
@ -581,9 +581,13 @@
|
|||||||
|
|
||||||
editormd.$marked = marked;
|
editormd.$marked = marked;
|
||||||
|
|
||||||
|
if(!settings.highlightStyle){
|
||||||
|
settings.highlightStyle = "github";
|
||||||
|
}
|
||||||
if (settings.previewCodeHighlight)
|
if (settings.previewCodeHighlight)
|
||||||
{
|
{
|
||||||
editormd.loadScript(loadPath + "prettify.min", function() {
|
editormd.loadCSS(loadPath + "highlight/styles/" + settings.highlightStyle);
|
||||||
|
editormd.loadScript(loadPath + "highlight/highlight", function() {
|
||||||
loadFlowChartOrSequenceDiagram();
|
loadFlowChartOrSequenceDiagram();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1473,12 +1477,15 @@
|
|||||||
|
|
||||||
if (settings.previewCodeHighlight)
|
if (settings.previewCodeHighlight)
|
||||||
{
|
{
|
||||||
previewContainer.find("pre").addClass("prettyprint linenums");
|
// previewContainer.find("pre").addClass("prettyprint");
|
||||||
|
//
|
||||||
if (typeof prettyPrint !== "undefined")
|
// if (typeof prettyPrint !== "undefined")
|
||||||
{
|
// {
|
||||||
prettyPrint();
|
// prettyPrint();
|
||||||
}
|
// }
|
||||||
|
previewContainer.find("pre").each(function (i, block) {
|
||||||
|
hljs.highlightBlock(block);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
@ -3994,7 +4001,7 @@
|
|||||||
|
|
||||||
if (settings.previewCodeHighlight)
|
if (settings.previewCodeHighlight)
|
||||||
{
|
{
|
||||||
div.find("pre").addClass("prettyprint linenums");
|
div.find("pre").addClass("prettyprint");
|
||||||
prettyPrint();
|
prettyPrint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
static/editor.md/lib/highlight/blueprint.png
Normal file
BIN
static/editor.md/lib/highlight/blueprint.png
Normal file
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
Loading…
Reference in New Issue
Block a user