summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
authorYukai Huang2017-01-02 15:09:19 +0800
committerYukai Huang2017-01-02 15:09:19 +0800
commit65acaea8cf47629c7e5710e444973a04526b047d (patch)
treef09efeaab513ffd7fb58d2af17a1ea1070a02251 /lib/response.js
parent1e276fb37a4ed8e19234de7192d8593314f53799 (diff)
parentac2b100d35bd9dd9bcbca8e622a5e7ed48222598 (diff)
Merge branch 'master' into frontend-next
Diffstat (limited to '')
-rwxr-xr-xlib/response.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/response.js b/lib/response.js
index 2b38cf25..54e2a337 100755
--- a/lib/response.js
+++ b/lib/response.js
@@ -75,7 +75,7 @@ function showIndex(req, res, next) {
}
function responseHackMD(res, note) {
- var body = LZString.decompressFromBase64(note.content);
+ var body = note.content;
var meta = null;
try {
meta = models.Note.parseMeta(metaMarked(body).meta);
@@ -191,7 +191,7 @@ function showPublishNote(req, res, next) {
if (!note) {
return response.errorNotFound(res);
}
- var body = LZString.decompressFromBase64(note.content);
+ var body = note.content;
var meta = null;
var markdown = null;
try {
@@ -209,7 +209,7 @@ function showPublishNote(req, res, next) {
var origin = config.serverurl;
var data = {
title: title,
- description: meta.description || markdown ? models.Note.generateDescription(markdown) : null,
+ description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
viewcount: note.viewcount,
createtime: createtime,
updatetime: updatetime,
@@ -248,7 +248,7 @@ function actionSlide(req, res, note) {
}
function actionDownload(req, res, note) {
- var body = LZString.decompressFromBase64(note.content);
+ var body = note.content;
var title = models.Note.decodeTitle(note.title);
var filename = title;
filename = encodeURIComponent(filename);
@@ -265,7 +265,7 @@ function actionDownload(req, res, note) {
}
function actionInfo(req, res, note) {
- var body = LZString.decompressFromBase64(note.content);
+ var body = note.content;
var meta = null;
var markdown = null;
try {
@@ -281,7 +281,7 @@ function actionInfo(req, res, note) {
var title = models.Note.decodeTitle(note.title);
var data = {
title: meta.title || title,
- description: meta.description || markdown ? models.Note.generateDescription(markdown) : null,
+ description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
viewcount: note.viewcount,
createtime: createtime,
updatetime: updatetime
@@ -297,7 +297,7 @@ function actionInfo(req, res, note) {
}
function actionPDF(req, res, note) {
- var body = LZString.decompressFromBase64(note.content);
+ var body = note.content;
try {
body = metaMarked(body).markdown;
} catch(err) {
@@ -479,7 +479,7 @@ function githubActionGist(req, res, note) {
if (!error && httpResponse.statusCode == 200) {
var access_token = body.access_token;
if (access_token) {
- var content = LZString.decompressFromBase64(note.content);
+ var content = note.content;
var title = models.Note.decodeTitle(note.title);
var filename = title.replace('/', ' ') + '.md';
var gist = {
@@ -579,7 +579,7 @@ function showPublishSlide(req, res, next) {
if (!note) {
return response.errorNotFound(res);
}
- var body = LZString.decompressFromBase64(note.content);
+ var body = note.content;
var meta = null;
var markdown = null;
try {
@@ -597,7 +597,7 @@ function showPublishSlide(req, res, next) {
var origin = config.serverurl;
var data = {
title: title,
- description: meta.description || markdown ? models.Note.generateDescription(markdown) : null,
+ description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
viewcount: note.viewcount,
createtime: createtime,
updatetime: updatetime,