In a html file, there is some code used custom template-language:
This feature has been implemented and you can now disable formatting for the regions of code using the special comments.
After enabling this feature in the settings, add //@formatter:off
at the start of your region, and //@formatter:on
at the end of it.
These are the default markers, and they are configurable.
You can find more details and examples in the documentation:
Original answer from 2012:
It's not possible yet, please vote for this feature request: