浏览代码

修复导出pdf无法识别上传的图片的问题。

Minho 8 年之前
父节点
当前提交
6f9367941d
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 2 0
      controllers/document.go
  2. 2 6
      views/document/export.tpl

+ 2 - 0
controllers/document.go

@@ -1083,6 +1083,8 @@ func RecursiveFun(parent_id int, prefix, dpath string, c *DocumentController, bo
 				c.Abort("500")
 			}
 			//beego.Info(fpath,html)
+			html = strings.Replace(html,"<img src=\"/uploads","<img src=\""+ c.BaseUrl() +"/uploads",-1)
+
 			f.WriteString(html)
 			f.Close()
 

+ 2 - 6
views/document/export.tpl

@@ -17,15 +17,11 @@
     <link href="{{.BaseUrl}}/static/css/jstree.css" rel="stylesheet">
     {{if eq .Model.Editor "markdown"}}
     <link href="{{.BaseUrl}}/static/editor.md/css/editormd.preview.css" rel="stylesheet">
+    <link href="{{.BaseUrl}}/static/prettify/themes/atelier-estuary-dark.min.css" rel="stylesheet">
+    <link href="{{.BaseUrl}}/static/css/markdown.preview.css" rel="stylesheet">
     {{else}}
     <link href="{{.BaseUrl}}/static/highlight/styles/zenburn.css" rel="stylesheet">
     {{end}}
-    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
-    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
-    <!--[if lt IE 9]>
-    <script src="{{.BaseUrl}}/static/html5shiv/3.7.3/html5shiv.min.js"></script>
-    <script src="{{.BaseUrl}}/static/respond.js/1.4.2/respond.min.js"></script>
-    <![endif]-->
 </head>
 <body>
 <div class="m-manual manual-reader">