You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WebStorm:如何配置HTML插值表达式{{}}内的空格格式化规则?

Fixing Space Formatting for Interpolation Expressions in WebStorm HTML Templates

Got it, I know exactly where to adjust this setting since the TypeScript one only applies to .ts files. Here's how to get your HTML template interpolations formatted with spaces inside {{}}:

  • Open WebStorm's settings:
    • On Windows/Linux: Use Ctrl+Alt+S, or go to File > Settings
    • On Mac: Use Cmd+,, or go to WebStorm > Preferences
  • Navigate to Editor > Code Style > HTML
  • Switch to the Other tab (it's near the top right of the settings panel)
  • Scroll down to the Handlebars/Mustache section—this covers most framework interpolation syntaxes like Vue, Angular, or Handlebars itself
  • Check the box labeled Add space inside handlebars expressions (the exact wording might vary slightly across WebStorm versions, but it'll clearly reference adding spaces inside {{}})
  • Click Apply then OK to save the changes

Now when you hit Ctrl+Alt+L to format your HTML files, any interpolation like {{userName}} will automatically become {{ userName }} with spaces inside the curly braces.

内容的提问来源于stack exchange,提问作者Platon Efimov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:18:51