summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--public/js/extra.js6
-rw-r--r--public/js/index.js2
-rw-r--r--public/js/pretty.js2
3 files changed, 7 insertions, 3 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 28a91fbc..cbb30697 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -66,7 +66,7 @@ function slugifyWithUTF8(text) {
}
//parse meta
-function parseMeta(md, view, toc, tocAffix) {
+function parseMeta(md, edit, view, toc, tocAffix) {
var robots = null;
var lang = null;
var dir = null;
@@ -93,10 +93,14 @@ function parseMeta(md, view, toc, tocAffix) {
view.attr('lang', lang);
toc.attr('lang', lang);
tocAffix.attr('lang', lang);
+ if (edit)
+ edit.attr('lang', lang);
} else {
view.removeAttr('lang');
toc.removeAttr('lang');
tocAffix.removeAttr('lang');
+ if (edit)
+ edit.removeAttr('lang', lang);
}
//text direction
if (dir) {
diff --git a/public/js/index.js b/public/js/index.js
index 3507e016..22aef5b7 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2137,7 +2137,7 @@ function updateViewInner() {
var rendered = md.render(value);
// only render again when meta changed
if (JSON.stringify(md.meta) != JSON.stringify(lastMeta)) {
- parseMeta(md, ui.area.markdown, $('#toc'), $('#toc-affix'));
+ parseMeta(md, ui.area.codemirror, ui.area.markdown, $('#toc'), $('#toc-affix'));
rendered = md.render(value);
}
// prevent XSS
diff --git a/public/js/pretty.js b/public/js/pretty.js
index 40d90cf7..44d27e54 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -5,7 +5,7 @@ md.meta = {};
var rendered = md.render(text);
// only render again when meta changed
if (JSON.stringify(md.meta) != JSON.stringify(lastMeta)) {
- parseMeta(md, markdown, $('#toc'), $('#toc-affix'));
+ parseMeta(md, null, markdown, $('#toc'), $('#toc-affix'));
rendered = md.render(text);
}
// prevent XSS