Module: Redmine::WikiFormatting::CommonMark

Defined in:
lib/redmine/wiki_formatting/common_mark/helper.rb,
lib/redmine/wiki_formatting/common_mark/formatter.rb,
lib/redmine/wiki_formatting/common_mark/html_parser.rb,
lib/redmine/wiki_formatting/common_mark/markdown_filter.rb,
lib/redmine/wiki_formatting/common_mark/alerts_icons_filter.rb,
lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb,
lib/redmine/wiki_formatting/common_mark/external_links_filter.rb,
lib/redmine/wiki_formatting/common_mark/append_spaces_to_lines.rb,
lib/redmine/wiki_formatting/common_mark/fixup_auto_links_filter.rb,
lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb

Defined Under Namespace

Modules: Helper Classes: AlertsIconsFilter, AppendSpacesToLines, ExternalLinksFilter, FixupAutoLinksFilter, Formatter, HtmlParser, MarkdownFilter, SanitizationFilter, SyntaxHighlightFilter

Constant Summary collapse

PIPELINE_CONFIG =

configuration of the rendering pipeline

{
  # https://github.com/gjtorikian/commonmarker#extension-options
  commonmarker_extensions: {
    table: true,
    strikethrough: true,
    tagfilter: true,
    autolink: true,
    footnotes: true,
    header_ids: nil,
    tasklist: true,
    shortcodes: false,
    alerts: true,
  }.freeze,

  # https://github.com/gjtorikian/commonmarker#parse-options
  commonmarker_parse_options: {
  }.freeze,

  # https://github.com/gjtorikian/commonmarker#render-options
  commonmarker_render_options: {
    unsafe: true,
    github_pre_lang: false,
    hardbreaks: Redmine::Configuration['common_mark_enable_hardbreaks'] == true,
    tasklist_classes: true,
  }.freeze,
  commonmarker_plugins: {
    syntax_highlighter: nil
  }.freeze,
}.freeze
MarkdownPipeline =
HTML::Pipeline.new [
  MarkdownFilter,
  SanitizationFilter,
  SyntaxHighlightFilter,
  FixupAutoLinksFilter,
  ExternalLinksFilter,
  AlertsIconsFilter
], PIPELINE_CONFIG
ALERT_TYPE_TO_ICON_NAME =

Defines the mapping from alert type (from CSS class) to SVG icon name. These icon names must correspond to IDs in your SVG sprite sheet (e.g., icons.svg).

{
  'note' => 'help',
  'tip' => 'bulb',
  'warning' => 'warning',
  'caution' => 'alert-circle',
  'important' => 'message-report',
}.freeze