HTML Reformat no line break if onclick attribute

I am a web storm newbie. Trying to prevent line wrapping within an attribute when I reformat HTML. Can anyone point me in the right direction to the correct setting? For example on a button. This wraps after the curly braces.

<button type="button" class="btn btn-success" onclick="ltgFormAction('?action=save&record={{asset.ID}}
&method=Asset_Save');">

I have tried 

Settings | Editor | Code Style | HTML, set Wrap attributes to Do not wrap

Doesnt work
Thanks Paul

0
4 comments

Unfortunately I failed to reproduce the issue - even with Hard wrap at: set to some very low values, like 10 or even 0, the method itself is not wrapped, I get

<button class="btn btn-success"
        onclick="ltgFormAction('?action=save&record={{asset.ID}}&method=Asset_Save');"
        type="button"></button>

Does it happen when editing pure HTML, or some template? What IDE version do you use?

0

Thank you for reply version 2023.1.1. 

Its editing a partial HTML file with handlebars tags ie I include this in a template. When I press ctrl-alt-L to reformat it breaks after the }} in all cases. I have the handlebars option enabled I think its somethign to do with that.

0

I see, thank you
I created https://youtrack.jetbrains.com/issue/WEB-63069/Handlebars-function-calls-in-event-handlers-are-broken-on-formatting-if-they-include-double-curly-braces, please follow it for updates
As a workaround I'd suggest increasing the Hard wrap at: value in Settings | Editor | Code Style

0

Please sign in to leave a comment.