We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71326ff commit ca48251Copy full SHA for ca48251
1 file changed
lib/rdoc/markup/to_html.rb
@@ -1,6 +1,7 @@
1
# frozen_string_literal: true
2
require 'cgi/escape'
3
require 'cgi/util' unless defined?(CGI::EscapeExt)
4
+require 'prism'
5
6
##
7
# Outputs RDoc markup as HTML.
@@ -568,14 +569,7 @@ def list_end_for(list_type)
568
569
# Returns true if text is valid ruby syntax
570
571
def parseable?(text)
- verbose, $VERBOSE = $VERBOSE, nil
572
- catch(:valid) do
573
- eval("BEGIN { throw :valid, true }\n#{text}")
574
- end
575
- rescue SyntaxError
576
- false
577
- ensure
578
- $VERBOSE = verbose
+ Prism.parse_success?(text)
579
end
580
581
0 commit comments