diff --git a/lib/loofah/scrubbers.rb b/lib/loofah/scrubbers.rb index 63d3aec..db84131 100644 --- a/lib/loofah/scrubbers.rb +++ b/lib/loofah/scrubbers.rb @@ -350,6 +350,24 @@ def scrub(node) end end + # + # === scrub!(:double_breakpoint) + # + # +:double_breakpoint+ replaces double-break tags with closing/opening paragraph tags. + # + # double_breakpoint_markup = "

Some text here in a logical paragraph.

Some more text, apparently a second paragraph.

" + # Loofah.html5_fragment(messy_markup).scrub!(:double_breakpoint) + # => "

Some text here in a logical paragraph.

Some more text, apparently a second paragraph.

" + # + class DoubleBreakpoint < Scrubber + def initialize # rubocop:disable Lint/MissingSuper + @direction = :top_down + end + + def scrub(node) + + end + end # # A hash that maps a symbol (like +:prune+) to the appropriate Scrubber (Loofah::Scrubbers::Prune). # @@ -364,6 +382,7 @@ def scrub(node) targetblank: TargetBlank, newline_block_elements: NewlineBlockElements, unprintable: Unprintable, + double_breakpoint: DoubleBreakpoint, } class << self