 %}', false); // synchronous request
                      xhr.setRequestHeader('X-CSRFToken', getCookie('csrftoken'));
                      xhr.send(formData);

                      if (xhr.status === 200) {
                          return xhr.responseText;
                      }

                      return 'Error rendering markdown';
                  }
              });

              // Store the editor instance
              editors.set(textarea.name, editor);

              // Add change handler