lockup icon indicating copy to clipboard operation
lockup copied to clipboard

CSS/JS partials don't render correctly in a development environnement

Open oz-tal opened this issue 11 months ago • 0 comments

The way the CSS and JS is rendered in the layout is currently problematic in a development environnement.

https://github.com/interdiscipline/lockup/blob/72624656305e9c5f37aabd713ea8dfdab372f3d6/app/views/layouts/lockup/application.html.erb#L9-L14

Rails assume the content of the html.erb files will actually be HTML, and will automatically add HTML comment denoting the start and end of the partial in the final view. The result of this behavior is the inclusion of comments with invalid syntax within the style and the script tag, notably hindering the interpretation of the JS, and thus breaking the hint button.

I suggest to simply move the style and the script tag inside the partial themselves to avoid the issue.

oz-tal avatar Feb 08 '25 17:02 oz-tal