diff options
Diffstat (limited to 'lib/rdoc/markup/to_html.rb')
-rw-r--r-- | lib/rdoc/markup/to_html.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb index 823b023e72..2b1216ef2a 100644 --- a/lib/rdoc/markup/to_html.rb +++ b/lib/rdoc/markup/to_html.rb @@ -286,7 +286,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter @res << to_html(heading.text) unless @options.pipe then @res << "<span><a href=\"##{label}\">¶</a>" - @res << " <a href=\"#documentation\">↑</a></span>" + @res << " <a href=\"#top\">↑</a></span>" end @res << "</h#{level}>\n" end @@ -379,11 +379,12 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter end ## - # Returns true if Ripper is available it can create a sexp from +text+ + # Returns true if text is valid ruby syntax def parseable? text - text =~ /\b(def|class|module|require) |=>|\{\s?\||do \|/ and - text !~ /<%|%>/ + eval("BEGIN {return true}\n#{text}") + rescue SyntaxError + false end ## |