Created
February 9, 2014 16:58
-
-
Save josephzidell/8902100 to your computer and use it in GitHub Desktop.
Markdown adding spaces - a simpler case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```html | |
<a href="mailto:404-Not-Found@example.com?subject=Hi!&amp;body=Either type the email address or use the form. Thanks!"></a> | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre lang="html"><code><a href="mailto:404-Not-Found@example.com?subject=Hi!&amp;amp;body=Either type the email address or use the form. Thanks!"></a> | |
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PostsHelper | |
def to_html(markdown) | |
pipeline = HTML::Pipeline.new [ | |
HTML::Pipeline::MarkdownFilter, | |
# HTML::Pipeline::SyntaxHighlightFilter # isolate problem - just use markdown filter | |
] | |
pipeline.call(markdown)[:output].to_s | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%h1= link_to @post.title, @post | |
= raw to_html @post.body_markdown | |
=# raw @post.body_html | |
%hr | |
%br | |
= render 'disqus' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment