From e39ef5b2046fcd0187c39b39c178368e59dc0419 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Wed, 24 Dec 2025 10:14:18 -0300 Subject: [PATCH] Standardize HardBreak markup --- lib/rdoc/markup/hard_break.rb | 57 ++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/lib/rdoc/markup/hard_break.rb b/lib/rdoc/markup/hard_break.rb index e1a4270b94..62ee63c8fd 100644 --- a/lib/rdoc/markup/hard_break.rb +++ b/lib/rdoc/markup/hard_break.rb @@ -1,31 +1,34 @@ # frozen_string_literal: true -## -# A hard-break in the middle of a paragraph. -class RDoc::Markup::HardBreak - - @instance = new - - ## - # RDoc::Markup::HardBreak is a singleton - - def self.new - @instance - end - - ## - # Calls #accept_hard_break on +visitor+ - - def accept(visitor) - visitor.accept_hard_break self +module RDoc + class Markup + # A hard-break in the middle of a paragraph. + class HardBreak < Element + @instance = new + + # RDoc::Markup::HardBreak is a singleton + #: () -> HardBreak + def self.new + @instance + end + + # Calls #accept_hard_break on +visitor+ + # @override + #: (untyped) -> void + def accept(visitor) + visitor.accept_hard_break(self) + end + + #: (top) -> bool + def ==(other) # :nodoc: + self.class === other + end + + # @override + #: (PP) -> void + def pretty_print(q) # :nodoc: + q.text("[break]") + end + end end - - def ==(other) # :nodoc: - self.class === other - end - - def pretty_print(q) # :nodoc: - q.text "[break]" - end - end