Skip to content

Commit fc0f942

Browse files
authored
Merge branch 'master' into preview-on-change
2 parents 8f763d7 + 8303634 commit fc0f942

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

martor/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
'mention': 'false', # to enable/disable mention
99
'jquery': 'true', # to include/revoke jquery (require for admin default django)
1010
'living': 'false', # to enable/disable live updates in preview
11-
'spellcheck': 'true', # to enable/disable spellcheck in form textareas
11+
'spellcheck': 'true', # to enable/disable spellcheck in form textareas
12+
'hljs': 'true', # to enable/disable hljs highlighting in preview
1213
}
1314
)
1415

martor/static/martor/js/martor.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,12 @@
162162
contentType: false,
163163
success: function(response) {
164164
if (response) {
165-
currentTab.html(response);
166-
$('pre').each(function (i, block) {
167-
hljs.highlightBlock(block);
168-
});
165+
currentTab.html(response).removeClass('martor-preview-stale');
166+
if (editorConfig.hljs == 'true') {
167+
$('pre').each(function (i, block) {
168+
hljs.highlightBlock(block);
169+
});
170+
}
169171
needsRefresh = false;
170172
} else {
171173
currentTab.html('<p>Nothing to preview</p>');

0 commit comments

Comments
 (0)