In a html file, there is some code used custom template-language:
<script type="text/javascript">
function ($scope, JsRoutes) {
$scope.rows = [
${"#{list rows, as: 'row', separator: ','}"}
{
#{list fieldConfigs, as: 'f', separator: ','}
${f.name} : ${'$'}{row.${f.name}.toJson()}#{/list}
}
${'#{/list}'}
]
}
</script>
Is it possible to configure intellij-idea not to format it(but format the other part of the document)? Since idea will make it hard to read after formatting:
<script type="text/javascript">
function ($scope, JsRoutes) {
$scope.rows = [
${"#{list rows, as: 'row', separator: ','}"}
{
#{list fieldConfigs, as: 'f', separator: ','}
${f.name} :
${'$'}{
row.${f.name}.toJson()
}#{/list}
}
${'#{/list}'}
]
}
</script>
In my version EAP 13.1, you must enable the following option in settings,
Preferences
-> Code Style
-> General
-> Formatter Control
-> Enable formatter markers in comments
before you can use these comments,
// @formatter:off
// @formatter:on
or these (depending on language):
<!--@formatter:off-->
<!--@formatter:on-->
Screenshot: