From dafbd6bde4d4e3b5a116b7640bbd2bfdea30488d Mon Sep 17 00:00:00 2001 From: swaggboi Date: Sat, 12 Apr 2025 12:05:28 -0400 Subject: [PATCH] Do if-markdown stuff in templates --- README.md | 1 - templates/remark/by_id.html.ep | 4 ++++ templates/remark/create.html.ep | 12 ++++++++++-- templates/thread/by_id.html.ep | 8 ++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cac897c..0846d05 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,6 @@ tests locally: ## TODOs -- Do the if-markdown-else-plaintext stuff in templates - Fix preview tests - Do I need `SUM` for `by_id()`? diff --git a/templates/remark/by_id.html.ep b/templates/remark/by_id.html.ep index b49fc1a..0038aaa 100644 --- a/templates/remark/by_id.html.ep +++ b/templates/remark/by_id.html.ep @@ -25,7 +25,11 @@
<%= $remark->{'author'} %>
+ <% if ($remark->{'markdown'}) { =%> <%== markdown $remark->{'body'} =%> + <% } else { =%> + <%= $remark->{'body'} %> + <% } =%>