File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ def strip_stars text
169
169
170
170
encoding = text . encoding
171
171
172
- text = text . gsub %r%Document-method:\s +[\w :.#=!?]+% , ''
172
+ text = text . gsub %r%Document-method:\s +[\w :.#=!?|^&<>~+-/* \% @` \[ \] ]+% , ''
173
173
174
174
space = ' '
175
175
space = RDoc ::Encoding . change_encoding space , encoding if encoding
Original file line number Diff line number Diff line change @@ -378,6 +378,32 @@ def test_strip_stars_document_method
378
378
assert_equal expected , strip_stars ( text )
379
379
end
380
380
381
+ def test_strip_stars_document_method_special
382
+ text = <<-TEXT
383
+ /*
384
+ * Document-method: Zlib::GzipFile#mtime=
385
+ * Document-method: []
386
+ * Document-method: `
387
+ * Document-method: |
388
+ * Document-method: &
389
+ * Document-method: <=>
390
+ * Document-method: =~
391
+ * Document-method: +
392
+ * Document-method: -
393
+ * Document-method: +@
394
+ *
395
+ * A comment
396
+ */
397
+ TEXT
398
+
399
+ expected = <<-EXPECTED
400
+
401
+ A comment
402
+ EXPECTED
403
+
404
+ assert_equal expected , strip_stars ( text )
405
+ end
406
+
381
407
def test_strip_stars_encoding
382
408
text = <<-TEXT
383
409
/*
You can’t perform that action at this time.
0 commit comments