Files
blogger-nodejs/views/posts/post.ejs
DeaDvey 9b5d3f3f73 Fixed issue relating to showdownjs not escaping html tags by porting to
markdown-it, also introduced a new function: func.render_md
2025-08-27 15:09:57 +01:00

29 lines
1.0 KiB
Plaintext

<h1>
<%= post.title %>
</h1>
<%- func.render_md(post.content) %><br/>
<i>
<%= locale.written_by %> <a href="/user/<%= user.username %>"><%= user.username %></a><br/>
</i>
<%- func.hyperlink_tags(post.tags) %><br/>
<a href="<%= config.edit_post_base_url %>/<%= postID %>"><%= locale.edit_post %></a><br/>
<i><%= locale.published %>: <%= func.unix_time_to_date_format(post.pubdate) %></i><br/>
<i><%= locale.last_modified %>: <%= func.unix_time_to_date_format(post.pubdate) %></i><br/>
<%- config.seperator %>
<!-- Comment form -->
<form method="POST" action="/submit_comment">
<input type="hidden" name="post_index" value="<%= postID %>">
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
<label><%= locale.comment %>:</label><br/><textarea name="content"></textarea><br/>
<button type="submit"><%= locale.submit %></button>
</form>
<% comments.forEach((comment, postID) => { %>
<%- include('../partials/comment', {comment: comment}) %>
<% }) %>
<%- config.seperator %>