Skip to content

Conversation

@marcoroth
Copy link
Owner

@marcoroth marcoroth commented Oct 21, 2025

This pull request updates the herb_extract_ruby_to_buffer_with_semicolons method, so we always put a whitespace before the semicolon when extracting Ruby code from a HTML+ERB template.

With that, we can support parsing, compiling, and rendering the following template:

<%
=begin%>
  This, while unusual, is a legal form of commenting.
<%
=end%>
<div>Hey there</div>

The problem is that =begin; isn't valid Ruby syntax

=begin;


=end;
 

Whereas this is:

=begin ;


=end ;
 

So we always replace the closing %> ERB tag with " ;" instead of "; " so it always ends up with valid extracted Ruby code.

Addresses #562 (comment)

/cc @asilano

@marcoroth marcoroth added the feature New feature or request label Oct 21, 2025
@marcoroth marcoroth merged commit 7c55448 into main Oct 21, 2025
20 checks passed
@marcoroth marcoroth deleted the block-comment-with-no-spaces branch October 21, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine feature New feature or request

2 participants