Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rdoc/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def strip_stars text

encoding = text.encoding

text = text.gsub %r%Document-method:\s+[\w:.#=!?]+%, ''
text = text.gsub %r%Document-method:\s+[\w:.#=!?|^&<>~+-/*\%@`\[\]]+%, ''

space = ' '
space = RDoc::Encoding.change_encoding space, encoding if encoding
Expand Down
26 changes: 26 additions & 0 deletions test/test_rdoc_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,32 @@ def test_strip_stars_document_method
assert_equal expected, strip_stars(text)
end

def test_strip_stars_document_method_special
text = <<-TEXT
/*
* Document-method: Zlib::GzipFile#mtime=
* Document-method: []
* Document-method: `
* Document-method: |
* Document-method: &
* Document-method: <=>
* Document-method: =~
* Document-method: +
* Document-method: -
* Document-method: +@
*
* A comment
*/
TEXT

expected = <<-EXPECTED

A comment
EXPECTED

assert_equal expected, strip_stars(text)
end

def test_strip_stars_encoding
text = <<-TEXT
/*
Expand Down