mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 02:01:42 +00:00
usar commonmarker closes #34
This commit is contained in:
parent
5ec7c45861
commit
bd3a19de14
3 changed files with 24 additions and 0 deletions
1
Gemfile
1
Gemfile
|
@ -30,6 +30,7 @@ gem 'jbuilder', '~> 2.5'
|
|||
# Use Capistrano for deployment
|
||||
# gem 'capistrano-rails', group: :development
|
||||
|
||||
gem 'commonmarker'
|
||||
gem 'email_address'
|
||||
gem 'rails_warden'
|
||||
gem 'haml-rails'
|
||||
|
|
|
@ -80,6 +80,8 @@ GEM
|
|||
chronic (0.10.2)
|
||||
coderay (1.1.2)
|
||||
colorator (1.1.0)
|
||||
commonmarker (0.17.8)
|
||||
ruby-enum (~> 0.5)
|
||||
concurrent-ruby (1.0.5)
|
||||
crass (1.0.3)
|
||||
dotenv (2.2.1)
|
||||
|
@ -213,6 +215,8 @@ GEM
|
|||
rbnacl (4.0.2)
|
||||
ffi
|
||||
rouge (3.1.0)
|
||||
ruby-enum (0.7.2)
|
||||
i18n
|
||||
ruby_dep (1.5.0)
|
||||
ruby_parser (3.10.1)
|
||||
sexp_processor (~> 4.9)
|
||||
|
@ -288,6 +292,7 @@ DEPENDENCIES
|
|||
capistrano-rails
|
||||
capistrano-rbenv
|
||||
capybara (~> 2.13)
|
||||
commonmarker
|
||||
dotenv-rails
|
||||
email_address
|
||||
exception_notification
|
||||
|
|
18
config/initializers/commonmarker.rb
Normal file
18
config/initializers/commonmarker.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'commonmarker'
|
||||
|
||||
module Haml::Filters
|
||||
|
||||
remove_filter("Markdown") #remove the existing Markdown filter
|
||||
|
||||
module Markdown
|
||||
|
||||
include Haml::Filters::Base
|
||||
|
||||
def render(text)
|
||||
CommonMarker.render_html(text,
|
||||
[:TABLE_PREFER_STYLE_ATTRIBUTES],
|
||||
[:table,:strikethrough,:autolink,:tagfilter])
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue