markdown optimization, few other changes

This commit is contained in:
jomo
2014-04-19 01:54:25 +02:00
parent 0264f239ba
commit 097f9b1ba4
12 changed files with 88 additions and 54 deletions

View File

@@ -11,7 +11,7 @@ atom_feed do |feed|
end
entry.url blogpost_url(post)
entry.title post.title
entry.content Sanitize.clean(render_md(post.content), Sanitize::Config::RELAXED).html_safe, :type => 'html'
entry.content render_md(post.content).html_safe, :type => 'html'
end
end
end

View File

@@ -13,7 +13,7 @@
<div class="items">
<div class="item content post">
<h2 class="headline"><%= link_to truncate(p.title, length: 60, omission: " …"), p %></h2>
<%= Sanitize.clean(render_md(p.content), Sanitize::Config::RELAXED).html_safe %>
<%= render_md(p.content).html_safe %>
</div>
</div>
</div>

View File

@@ -8,7 +8,7 @@
<div class="items">
<div class="item content">
<h2 class="headline"><%= link_to truncate(@post.title, length: 60, omission: " …"), p %></h2>
<%= Sanitize.clean(render_md(@post.content), Sanitize::Config::RELAXED).html_safe %>
<%= render_md(@post.content).html_safe %>
</div>
</div>
</div>

View File

@@ -6,7 +6,7 @@
</div>
<div class="items">
<div class="item content">
<%= Sanitize.clean(render_mini_md(c.content.gsub(/([\r\n]+\s*?){3,}/, "\n\n")), Sanitize::Config::BASIC).html_safe %>
<%= render_mini_md(c.content).html_safe %>
</div>
</div>
</div>

View File

@@ -1,7 +1,7 @@
<% if current_user %>
<h3>New comment</h3>
<%= simple_form_for [@post, @comment] do |f| %>
<p>> quote | _underline_ | *italic* | **bold** | `code` | [link](https://example.com)
<p><blockquote>&gt; quote</blockquote> | _underline_ | <i>*italic*</i> | <b>**bold**</b> | <code>`code`</code> | <mark>==mark==</mark> | <a>[link](https://example.com)</a>
<%= f.input :content, :label => false, :as => "text", :placeholder => "Comment", input_html: {class: "comment"} %>
<%= f.submit class: "btn blue" %>
<% end %>

View File

@@ -8,7 +8,7 @@
<div class="items">
<div class="item content">
<h2 class="headline"><%= link_to truncate(@thread.title, length: 60, omission: " …"), p %></h2>
<%= Sanitize.clean(render_md(@thread.content), Sanitize::Config::RELAXED).html_safe %>
<%= render_md(@thread.content).html_safe %>
</div>
</div>
</div>

View File

@@ -82,5 +82,5 @@
</tbody>
</table>
About:<br>
<%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %>
<%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : render_mini_md(@user.about).html_safe %>
</div>