diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 344c609b0..c162bce19 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -226,11 +226,6 @@ Style/PercentLiteralDelimiters: - 'spec/features/signin_spec.rb' - 'spec/features/signout_spec.rb' -# Cop supports --auto-correct. -Style/PerlBackrefs: - Exclude: - - 'lib/haml/filters/growstuff_markdown.rb' - # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed diff --git a/lib/haml/filters/growstuff_markdown.rb b/lib/haml/filters/growstuff_markdown.rb index e03e8c306..adf4391f6 100644 --- a/lib/haml/filters/growstuff_markdown.rb +++ b/lib/haml/filters/growstuff_markdown.rb @@ -2,55 +2,68 @@ require 'bluecloth' module Haml::Filters module GrowstuffMarkdown + include Haml::Filters::Base + + def render(text) + @expanded = text + expand_crops + expand_members + BlueCloth.new(@expanded).to_html + end + + private + CROP_REGEX = /(?