Skip to content

Commit 6b88ae0

Browse files
committed
Fix for "\n" after backslash escape
The "\n" after backslash escape is not correctly now, so the code below is broken in HTML. a = 1 if first_flag_var and \ this_is_flag_var This commit fixes it.
1 parent 0c47b30 commit 6b88ae0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/rdoc/ruby_lex.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,14 +769,11 @@ def lex_int2
769769

770770
@OP.def_rule('\\') do
771771
|op, io|
772-
if getc == "\n"
772+
if peek(0) == "\n"
773773
@space_seen = true
774774
@continue = true
775-
Token(TkSPACE)
776-
else
777-
ungetc
778-
Token("\\")
779775
end
776+
Token("\\")
780777
end
781778

782779
@OP.def_rule('%') do

0 commit comments

Comments
 (0)