Search code examples
webstormautoformatting

Exclude certain code from being auto formatted in WebStorm


WebStorm auto-formats my js file perfectly.

However, there is a situation I want to exclude some code from being auto-formatted, like anything between <pre><code> and </code></pre>. Auto-format introduces new white spaces. Normally it's not a problem. However, I want to preserve the white spaces between my <pre><code> and </code></pre> tags.


Solution

    1. Settings/Preferences | Editor | Code Style
    2. HTML | Other
    3. Make sure that such tags are listed in Keep white spaces inside list