From d1145510e2c7f04a12a021faeaad0138339ab04c Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Fri, 5 Jun 2026 20:58:11 -0400 Subject: [PATCH] feat: source_format selector on new-thread create form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The preview fix (64a15b6) honored source_format only when the textarea already declared one — which works for editing an existing node but not for creating a new one. Authors writing RST in the create form saw their preview rendered as markdown, then saved into a node whose source_format defaulted to markdown — so even the final saved page came back wrong. Three pieces: - create.j2: + + + + + + + + + +
{% 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: