I tested that the following changes the behavior as per your requirements:
(The numbers in the following steps map to the numbers in the screenshot)
- Go into Intellij IDEA Settings -> Code Style (1) -> HTML (2) -> Other (3)
- Then, under
Don't break if inline content
add 'div' by clicking on (4) and then (5).
After that attempting to format your code snippet does not push down extent
into the next line.