Multi-line HTML comments with <!--- and ---> are supported, and I actually 
just realized that you can't have <%# ... %> without pure Elixir content in 
the middle as <%..%> designates interpolation with pure Elixir code.

I retract my proposal.


On Friday, December 27, 2019 at 7:53:14 PM UTC-5, Julian Rachele wrote:
>
> Hello,
>
> Currently, comments in EEX are designated using <%# *commented out 
> content *%>.
> You may comment out multiple lines of EEX/HTML using this, such as 
>
> ```
> *<%#*
> *<div>*
> *<p></p>*
> *</div>*
> * %>*
> ```
> This works fine, if the content being commented out is pure HTML, that is, 
> if the content contains no %> of its own.
>
> The issue is that when commenting out Elixir template code, the compiler 
> interprets the *very first *%> as the designated end of the comment.
> So if you had commented code like this:
>
> ```
> *<%#*
> *<%= for i <- 1..5 do %>*
> <span><%= i %></span> 
> <% end %>
> %>
> ```
>
> The commented code is highlighted in bold, while the rest is to be parsed 
> by the compiler, and will result in a compilation error for mismatched 
> braces. 
> The issue persists for single-line comments as well.
>
> I suggest that we either:
> 1. Terminate comments with #%> instead of %>, but this would be a shift 
> from the currently accepted idea of ending all template tags with %>, such 
> as <%= ... %>. 
> 2. Improve the EEX syntax parser to check for well-formed comments in EEX. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/2a060611-95d9-425e-ba8d-d4d692258795%40googlegroups.com.

Reply via email to