File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -837,14 +837,11 @@ def lex_int2
837
837
838
838
@OP . def_rule ( '\\' ) do
839
839
|op , io |
840
- if getc == "\n "
840
+ if peek ( 0 ) == "\n "
841
841
@space_seen = true
842
842
@continue = true
843
- Token ( TkSPACE )
844
- else
845
- ungetc
846
- Token ( "\\ " )
847
843
end
844
+ Token ( "\\ " )
848
845
end
849
846
850
847
@OP . def_rule ( '%' ) do
Original file line number Diff line number Diff line change @@ -451,6 +451,22 @@ def test_accept_verbatim_parseable_error
451
451
assert_equal expected , @to . res . join
452
452
end
453
453
454
+ def test_accept_verbatim_nl_after_backslash
455
+ verb = @RM ::Verbatim . new ( "a = 1 if first_flag_var and \\ \n " , " this_is_flag_var\n " )
456
+
457
+ @to . start_accepting
458
+ @to . accept_verbatim verb
459
+
460
+ expected = <<-EXPECTED
461
+
462
+ <pre class="ruby"><span class="ruby-identifier">a</span> = <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">first_flag_var</span> <span class="ruby-keyword">and</span> \\
463
+ <span class="ruby-identifier">this_is_flag_var</span>
464
+ </pre>
465
+ EXPECTED
466
+
467
+ assert_equal expected , @to . res . join
468
+ end
469
+
454
470
def test_accept_verbatim_pipe
455
471
@options . pipe = true
456
472
You can’t perform that action at this time.
0 commit comments