From ee4210a5115e29d02bb1ae8fc6297c2c318eb24b Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Fri, 3 Jul 2020 00:06:03 +0200 Subject: Added dynamic lang-attr to pretty.ejs CodiMD currently only uses the 'lang' attribute in YAML-metadata of a note for setting certain js-elements of the markdown-renderer. This commit adds the chosen lang into the published version of a note. Signed-off-by: Erik Michelson --- lib/web/note/util.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/web/note/util.js') diff --git a/lib/web/note/util.js b/lib/web/note/util.js index c5affd05..128c89cf 100644 --- a/lib/web/note/util.js +++ b/lib/web/note/util.js @@ -81,6 +81,7 @@ exports.getPublishData = function (req, res, note, callback) { const data = { title: title, description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null), + lang: meta.lang || null viewcount: note.viewcount, createtime: createtime, updatetime: updatetime, -- cgit v1.2.3 From e4214f32a043acf186b91126a7f9e5f5ab1e4b14 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Sat, 4 Jul 2020 03:37:19 +0200 Subject: Fixed meta parsing of lang-attribute for using it in the published-view Signed-off-by: Erik Michelson --- lib/web/note/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/web/note/util.js') diff --git a/lib/web/note/util.js b/lib/web/note/util.js index 128c89cf..f1af1300 100644 --- a/lib/web/note/util.js +++ b/lib/web/note/util.js @@ -81,7 +81,7 @@ exports.getPublishData = function (req, res, note, callback) { const data = { title: title, description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null), - lang: meta.lang || null + lang: meta.lang || null, viewcount: note.viewcount, createtime: createtime, updatetime: updatetime, -- cgit v1.2.3