Skip to content

Commit

Permalink
initial scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
josecolella authored and flavorjones committed Dec 31, 2024
1 parent c949968 commit be68124
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/loofah/scrubbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<p>Some text here in a logical paragraph.<br><br>Some more text, apparently a second paragraph.</p>"
# Loofah.html5_fragment(messy_markup).scrub!(:double_breakpoint)
# => "<p>Some text here in a logical paragraph.</p><p>Some more text, apparently a second paragraph.</p>"
#
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).
#
Expand All @@ -364,6 +382,7 @@ def scrub(node)
targetblank: TargetBlank,
newline_block_elements: NewlineBlockElements,
unprintable: Unprintable,
double_breakpoint: DoubleBreakpoint,
}

class << self
Expand Down

0 comments on commit be68124

Please sign in to comment.