summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/js/extra.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index bec7fc78..fd22fc80 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -449,13 +449,16 @@ function finishView(view) {
var langDiv = $(value).find('code.hljs');
if (langDiv.length > 0) {
var reallang = langDiv[0].className.replace(/hljs|wrap/g, '').trim();
- if (!reallang) return;
var codeDiv = $(value).find('.code');
var code = "";
if (codeDiv.length > 0) code = codeDiv.html();
else code = langDiv.html();
code = md.utils.unescapeAll(code);
- if (reallang == "tiddlywiki" || reallang == "mediawiki") {
+ if (!reallang) {
+ var result = {
+ value: md.utils.escapeHtml(code)
+ };
+ } else if (reallang == "tiddlywiki" || reallang == "mediawiki") {
var result = {
value: Prism.highlight(code, Prism.languages.wiki)
};