Skip to content

Commit 91a8622

Browse files
fixed pandoc export docx with filesystem images
1 parent 907fdcd commit 91a8622

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/imageRouter/filesystem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ exports.uploadImage = function (req,imagePath, callback) {
7777

7878
let url
7979
try {
80-
url = (new URL(filename, config.serverURL + '/uploads/')).href
80+
url = (new URL(filename, 'http://' + config.domain + '/uploads/')).href
8181
} catch (e) {
82-
url = config.serverURL + '/uploads/' + filename
82+
url = 'http://' + config.domain + '/uploads/' + filename
8383
}
8484

8585
callback(null, url)

lib/note/noteActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function actionPandoc (req, res, note) {
145145
try {
146146
// TODO: timeout rejection
147147
await pandoc.convertToFile(content, 'markdown', exportType, path, [
148-
'--metadata', `title=${title}`, '--sandbox'
148+
'--metadata', `title=${title}` //, '--sandbox'
149149
])
150150

151151
var stream = fs.createReadStream(path)

0 commit comments

Comments
 (0)