5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 22:26:22 +00:00
panel/config/initializers/commonmarker.rb

18 lines
410 B
Ruby
Raw Normal View History

2019-03-26 15:32:20 +00:00
# frozen_string_literal: true
2018-02-23 19:12:39 +00:00
require 'commonmarker'
module Haml::Filters
2019-03-26 15:32:20 +00:00
remove_filter('Markdown') # remove the existing Markdown filter
2018-02-23 19:12:39 +00:00
module Markdown
include Haml::Filters::Base
def render(text)
CommonMarker.render_html(text,
2019-03-26 15:32:20 +00:00
[:TABLE_PREFER_STYLE_ATTRIBUTES],
%i[table strikethrough autolink tagfilter])
2018-02-23 19:12:39 +00:00
end
end
end