简体   繁体   English

防止 VSCode 包装 html 标签内容

[英]Prevent VSCode from wrapping html tag content

"html.format.wrapAttributes": "force-aligned" worked perfectly, it touched tag attributes and was doing nothing to tag content (I'm writing in Angular so its perfect for me) until today. "html.format.wrapAttributes": "force-aligned"工作得很好,它触及标签属性并且对标签内容没有做任何事情(我在 Angular 中写,所以它对我来说很完美)直到今天。 Content started to wrap in places I don't want it to wrap in, I just want it to be preserved as it is.内容开始包裹在我不想包裹的地方,我只是希望它保持原样。 Everywhere.到处。 "html.format.wrapLineLength": 0 isn't helping, as so html.format.contentUnformatted doesn't (when I start to add some tags there - everything breaks). "html.format.wrapLineLength": 0没有帮助,因此html.format.contentUnformatted没有帮助(当我开始在那里添加一些标签时 - 一切都中断了)。 I need a solution for this.我需要一个解决方案。

EDIT: For clearance I'm using "editor.defaultFormatter": "vscode.html-language-features"编辑:为了清除我正在使用"editor.defaultFormatter": "vscode.html-language-features"

EDIT: Another things that makes me lose my mind.编辑:另一件事让我失去理智。 Ternary operators are formatted from:三元运算符的格式来自:

 <span>
      {{
        isTrue 
          ? 'Yes'
          : 'No'
      }}
 </span>

To

      <span>
    {{
    isTrue
    ? 'Yes'
    : 'No'
    }}
</span>

And yes, that's how it really is in a html.是的,这就是 html 中的真实情况。

"html.format.templating": true, solves this issue. "html.format.templating": true,解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将内容子项包装在动态父标记中 - Wrapping content children in a dynamic parent tag Angular Material List:如何防止 mat-list-items 包装内容? - Angular Material List: How to prevent mat-list-items from wrapping content? 在Angular中包装html标签绑定的UI组件 - Wrapping html tag bound UI Components in Angular 从JSON渲染Html而不在Angular 4中显示样式标记的内容 - Render Html from JSON without displaying content of style tag in Angular 4 Angular6 嵌入/内容投影:更好的条件是包装 html - Angular6 transclusion / content projection: better conditional on wrapping html 使用 angular 中的 typescript 中的 html 元素包装组件 - Wrapping component with html element from typescript in angular Angular:可以从同一 HTML 标记中访问 HTML 属性的内容吗? - Angular: Can content of an HTML attribute accessed from within the same HTML tag? 当传递带有以下样式的html时<style> tag to [innerHTML], prevent them from affecting entire app - When passing html with styles defined in <style> tag to [innerHTML], prevent them from affecting entire app 如何在 for 循环中呈现 html 标签中的不同内容? - How to render different content in html tag in for loop? 从 DB 获取部分可编辑的 HTML 内容并绑定到 div 标签,Angular 6 - Get Partially Editable HTML Content from DB and bind to div tag, Angular 6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM