diff --git a/models/DocumentModel.go b/models/DocumentModel.go index 1b2677d4..3dc16efe 100644 --- a/models/DocumentModel.go +++ b/models/DocumentModel.go @@ -256,7 +256,7 @@ func (item *Document) ReleaseContent() error { if conf.BaseUrl != "" && !strings.HasPrefix(src, conf.BaseUrl) { contentSelection.SetAttr("target", "_blank") if html, err := content.Html(); err == nil { - item.Release = html + item.Release = strings.TrimSuffix(strings.TrimPrefix(strings.TrimSpace(html),"
"),"") } } } @@ -305,7 +305,15 @@ func (doc *Document) AppendInfo() *Document { docCreator, err := NewMember().Find(doc.MemberId,"real_name","account") - if strings.TrimSpace(doc.Release) != "" { + doc.Release = strings.TrimSuffix(strings.TrimPrefix(strings.TrimSpace(doc.Release),""),"") + suffix := "" + if doc.Release != "" { + beego.Info(doc.Release) + if strings.HasPrefix(doc.Release,"" + this.atLink(this.emoji(text)) + "
\n" ); @@ -3849,6 +3853,7 @@ { var text = toc[i].text; var level = toc[i].level; + var id = toc[i].id; if (level < startLevel) { continue; @@ -3860,16 +3865,17 @@ } else if (level < lastLevel) { - html += (new Array(lastLevel - level + 2)).join(""); + // html += (new Array(lastLevel - level + 2)).join(""); } else { - html += ""; + // html += ""; } - html += "