Skip to content

Commit 1495e82

Browse files
committed
Merge branch 'aycabta-bypass-erb'
2 parents b477af8 + 0bafe50 commit 1495e82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/rdoc/parser/ruby.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def initialize(top_level, file_name, content, options, stats)
178178
@size = 0
179179
@token_listeners = nil
180180
@scanner = RDoc::RipperStateLex.parse(content)
181+
@content = content
181182
@scanner_point = 0
182183
@prev_seek = nil
183184
@markup = @options.markup
@@ -2067,6 +2068,12 @@ def scan
20672068
parse_top_level_statements @top_level
20682069

20692070
rescue StandardError => e
2071+
if @content.include?('<%') and @content.include?('%>') then
2072+
# Maybe, this is ERB.
2073+
$stderr.puts "\033[2KRDoc detects ERB file. Skips it for compatibility:"
2074+
$stderr.puts @file_name
2075+
return
2076+
end
20702077
bytes = ''
20712078

20722079
if @scanner_point >= @scanner.size

0 commit comments

Comments
 (0)