diff --git a/remarkbox/templates/snippets/create.j2 b/remarkbox/templates/snippets/create.j2 index a4cff25..5ba1b5a 100644 --- a/remarkbox/templates/snippets/create.j2 +++ b/remarkbox/templates/snippets/create.j2 @@ -11,10 +11,24 @@ name = "thread_data" id = "thread_data_textarea" class = "common-textarea" + data-source-format = "markdown" onkeyup = "previewAjax( 'thread_data_textarea', 'preview', show_raw=true, mathjax={{ request.mathjax }} )" placeholder = "What do you want to say? markdown" required> + + +
{% include 'csrf.j2' %} diff --git a/remarkbox/views/new_thread.py b/remarkbox/views/new_thread.py index e088250..2e0f914 100644 --- a/remarkbox/views/new_thread.py +++ b/remarkbox/views/new_thread.py @@ -22,6 +22,7 @@ def new_thread(request): thread_title = request.params.get("thread_title", "") thread_data = request.params.get("thread_data", "") anonymous_name = request.params.get("anonymous_name", "").strip() + source_format = request.params.get("source_format", "").strip() or None if request.spam: return request.spam @@ -61,7 +62,7 @@ def new_thread(request): node.namespace = request.namespace node.ip_address = unicode(request.client_addr) node.title = thread_title - node.set_data(thread_data, dbsession=request.dbsession) + node.set_data(thread_data, dbsession=request.dbsession, source_format=source_format) # Handle anonymous vs authenticated user if user_surrogate: