2023-02-15 14:50:48 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "redcarpet/render_strip"
|
2015-01-12 04:00:00 -08:00
|
|
|
|
|
|
|
MARKDOWN_OPTS = {
|
2023-02-15 14:50:48 -08:00
|
|
|
no_intra_emphasis: true,
|
|
|
|
tables: true,
|
|
|
|
fenced_code_blocks: true,
|
|
|
|
autolink: true,
|
|
|
|
disable_indented_code_blocks: true,
|
|
|
|
strikethrough: true,
|
|
|
|
superscript: false,
|
|
|
|
}.freeze
|
|
|
|
|
|
|
|
MARKDOWN_RENDERER_OPTS = {
|
|
|
|
filter_html: true,
|
|
|
|
escape_html: true,
|
|
|
|
no_images: true,
|
|
|
|
no_styles: true,
|
|
|
|
safe_links_only: true,
|
|
|
|
xhtml: false,
|
|
|
|
hard_wrap: true,
|
|
|
|
}.freeze
|
2015-05-25 16:26:58 -07:00
|
|
|
|
2021-12-31 13:22:06 -08:00
|
|
|
ALLOWED_HOSTS_IN_MARKDOWN = [
|
2023-02-15 14:50:48 -08:00
|
|
|
APP_CONFIG["hostname"],
|
|
|
|
*APP_CONFIG["allowed_hosts_in_markdown"]
|
|
|
|
].freeze
|