Customize the Markdown renderer
mainMarksmith uses commonmarker by default, but you can switch to redcarpet or kramdown in your initializer.
Configure Redcarpet options
If using redcarpet, you can pass specific flags via redcarpet_options.
Implement a custom renderer
You can completely override the rendering logic by defining your own Marksmith::Renderer class.
# config/initializers/marksmith.rb
Marksmith.configure do |config|
config.parser = "redcarpet"
config.redcarpet_options = {
underline: false,
highlight: false
}
end# app/models/marksmith/renderer.rb
module Marksmith
class Renderer
def initialize(body:)
@body = body
end
def render
# Your custom renderer logic here
end
end
end