# File lib/rdoc/text.rb, line 167
def strip_stars text
return text unless text =~ %/\*.*\*/%
encoding = text.encoding
text = text.gsub %Document-method:\s+[\w:.#=!?|^&<>~+\-/*\%@`\[\]]+%, ''
space = ' '
space = RDoc::Encoding.change_encoding space, encoding if encoding
text.sub! %/\*+% do space * $&.length end
text.sub! %\*+/% do space * $&.length end
text.gsub! %^[ \t]*\*% do space * $&.length end
empty = ''
empty = RDoc::Encoding.change_encoding empty, encoding if encoding
text.gsub(/^\s+$/, empty)
end