aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/parser.rb')
-rw-r--r--lib/rdoc/parser.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb
index 1d4d0675b8..bf9ab77218 100644
--- a/lib/rdoc/parser.rb
+++ b/lib/rdoc/parser.rb
@@ -1,3 +1,5 @@
+# -*- coding: us-ascii -*-
+
##
# A parser is simple a class that subclasses RDoc::Parser and implements #scan
# to fill in an RDoc::TopLevel with parsed data.
@@ -157,11 +159,16 @@ class RDoc::Parser
io.gets
end
- line =~ /-\*-(.*?)-\*-/
+ /-\*-\s*(.*?\S)\s*-\*-/ =~ line
return nil unless type = $1
- type.strip.downcase
+ if /;/ =~ type then
+ return nil unless /(?:\s|\A)mode:\s*([^\s;]+)/i =~ type
+ type = $1
+ end
+
+ type.downcase
rescue ArgumentError # invalid byte sequence, etc.
end