Add backend for tips and enable markdown support

This commit is contained in:
Sebastian Serth
2020-10-08 19:04:10 +02:00
parent dce5998a2a
commit e550828c58
16 changed files with 171 additions and 10 deletions

View File

@ -30,7 +30,11 @@ $(document).on('turbolinks:load', function () {
editor.setShowPrintMargin(false);
editor.setTheme(THEME);
// For creating / editing an exercise
var textarea = $('textarea[id="exercise_files_attributes_' + index + '_content"]');
if ($('.edit_tip, .new_tip').isPresent()) {
textarea = $('textarea[id="tip_example"]')
}
var content = textarea.val();
if (content != undefined) {
@ -383,11 +387,11 @@ $(document).on('turbolinks:load', function () {
observeExportButtons();
}
toggleCodeHeight();
if (window.hljs) {
highlightCode();
}
}
if (window.hljs) {
highlightCode();
}
if ($('#editor-edit').isPresent()) {
configureEditors();