Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created April 27, 2010 22:26
Show Gist options
  • Save defunkt/381430 to your computer and use it in GitHub Desktop.
Save defunkt/381430 to your computer and use it in GitHub Desktop.
Mustache Markdown Helper
class MyView < Mustache
def markdown(str = nil)
if str
Markdown.new(str.to_s).to_html
else
lambda { |text| markdown(render(text)) }
end
end
end
<div class="column main">
{{# markdown}}
{{{ description }}}
{{/ markdown}}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment