Merge pull request #273 from gopesht/implements_markdown

Implements markdown
This commit is contained in:
Gopesh Tulsyan 2014-07-03 21:01:46 +05:30
commit fbf52b1d69
23 changed files with 3140 additions and 21 deletions

View file

@ -197,4 +197,18 @@ module ApplicationHelper
(short_title_brand(@conference) if @conference) ||
default_brand
end
def markdown(text)
options = {
autolink: true,
space_after_headers: true,
no_intra_emphasis: true
}
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options)
markdown.render(text).html_safe
end
def markdown_hint(text="")
markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text")
end
end