Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiline erb comments #21

Open
nevans opened this issue Mar 28, 2023 · 2 comments
Open

Handle multiline erb comments #21

nevans opened this issue Mar 28, 2023 · 2 comments
Assignees
Labels
looking for contributions This issue was accepted and is looking for a pull-request

Comments

@nevans
Copy link

nevans commented Mar 28, 2023

My code base had a few places where html had been temporarily commented out using syntax like so:

<%# See bug #1234
    <tr>
      <td>etc</td>
      <td>etc</td>
      <td>etc</td>
    </tr>
%>

I don't want the comments to be formatted (other than perhaps indentation if they are multiline). But erb-format misinterpreted the comments and seemed to get confused, treating the commented tags as real tags.

@nevans
Copy link
Author

nevans commented Mar 28, 2023

My apologies that this is just a simple "post and run" issue. Based on a quick skim of the codebase, I found it quite readable, and I'm sure I could post a PR for this... but I don't have time for it at the moment (and I worked around the issue by simply deleting the comments!)

@nevans nevans changed the title Handle erb comments Handle multiline erb comments Mar 28, 2023
@elia
Copy link
Member

elia commented Jul 7, 2023

I agree… if you have time to send that PR would be awesome, the starting point would be to adjust the expected output for multiline comments in https://github.com/nebulab/erb-formatter/blob/main/test/fixtures/comments.html.expected.erb

@elia elia self-assigned this Jul 7, 2023
@elia elia added the looking for contributions This issue was accepted and is looking for a pull-request label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
looking for contributions This issue was accepted and is looking for a pull-request
Projects
None yet
Development

No branches or pull requests

2 participants