summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/markup/parser.rb')
-rw-r--r--lib/rdoc/markup/parser.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/rdoc/markup/parser.rb b/lib/rdoc/markup/parser.rb
index 3ab72ee5d5..c18ce821fb 100644
--- a/lib/rdoc/markup/parser.rb
+++ b/lib/rdoc/markup/parser.rb
@@ -86,11 +86,18 @@ class RDoc::Markup::Parser
# Builds a Heading of +level+
def build_heading level
- _, text, = get # TEXT
- heading = RDoc::Markup::Heading.new level, text
- skip :NEWLINE
-
- heading
+ type, text, = get
+
+ text = case type
+ when :TEXT then
+ skip :NEWLINE
+ text
+ else
+ unget
+ ''
+ end
+
+ RDoc::Markup::Heading.new level, text
end
##