diff --git a/lib/PostText/Controller/Remark.pm b/lib/PostText/Controller/Remark.pm index 14eaec5..7df4f73 100644 --- a/lib/PostText/Controller/Remark.pm +++ b/lib/PostText/Controller/Remark.pm @@ -73,7 +73,7 @@ sub create($self) { })->fragment('remarks')); } - $draft = $remark_body; + $draft = {body => $remark_body, markdown => $markdown}; } } diff --git a/templates/remark/create.html.ep b/templates/remark/create.html.ep index a16860d..df26bbd 100644 --- a/templates/remark/create.html.ep +++ b/templates/remark/create.html.ep @@ -14,9 +14,13 @@ content="Remark on thread #<%= $thread->{'id'} %>."> <% end %>
- <% if ($draft) { =%> + <% if (keys %{$draft}) { =%>
- <%== markdown $draft =%> + <% if ($draft->{'markdown'}) { =%> + <%== markdown $draft->{'body'} =%> + <% } else { =%> + <%= $draft->{'body'} =%> + <% } =%>
<% } =%>
@@ -51,6 +55,10 @@ <%= check_box bump => 1, id => 'bump', checked => undef %> <%= label_for bump => 'Bump' %>
+
+ <%= check_box markdown => 1, id => 'markdown' %> + <%= label_for markdown => 'Markdown' %> +
<%= check_box preview => 1, id => 'preview' %> <%= label_for preview => 'Preview' %> @@ -72,7 +80,7 @@
- <%== markdown $last_remark->{'body'} =%> + <%= $last_remark->{'body'} =%>