Skip to content

Commit d90ce24

Browse files
committed
Moved #ignore to RDoc::Markup::Formatter so any formatter can ignore nodes
1 parent 725d921 commit d90ce24

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

lib/rdoc/markup/formatter.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ def convert_string string
114114
string
115115
end
116116

117+
##
118+
# Use ignore in your subclass to ignore the content of a node.
119+
#
120+
# ##
121+
# # We don't support raw nodes in ToNoRaw
122+
#
123+
# alias accept_raw ignore
124+
125+
def ignore node
126+
end
127+
117128
##
118129
# Are we currently inside tt tags?
119130

lib/rdoc/markup/to_html_snippet.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ def accept_heading heading
5656
end
5757

5858
##
59-
# Raw content is untrusted and ignored.
59+
# Raw sections are untrusted and ignored
6060

61-
def accept_raw raw
62-
end
61+
alias accept_raw ignore
6362

6463
##
6564
# Rules are ignored
6665

67-
def accept_rule rule
68-
end
66+
alias accept_rule ignore
6967

7068
def accept_paragraph paragraph
7169
para = @in_list_entry.last || "<p>"

lib/rdoc/markup/to_table_of_contents.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ def start_accepting
3939
@res = []
4040
end
4141

42-
##
43-
# Ignores the content of nodes that aren't headings
44-
45-
def ignore node
46-
end
47-
4842
# :stopdoc:
4943
alias accept_raw ignore
5044
alias accept_rule ignore

0 commit comments

Comments
 (0)