gpt4 book ai didi

visual-studio-code - VSCode Prettier 以一种奇怪的方式格式化 HTML(下一行大于符号)

转载 作者:行者123 更新时间:2023-12-04 11:58:06 26 4
gpt4 key购买 nike

从今天起,安装了 Prettier Extension 的 VSCode 以一种非常奇怪的方式格式化了我的 HTML。例如:

<button
class="btn btn-secondary mr-2"
(click)="updateEditState(EditState.preview)"
*ngIf="!(preview | async)"
>
<ng-container i18n="AppPreviewEditButton|Enables the Preview mode of the page@@AppPreviewButton"
>Preview</ng-container
>
</button>
<button class="btn btn-secondary mr-2" (click)="updateEditState(EditState.edit)" *ngIf="!(edit | async)">
<ng-container i18n="AppPreviewEditButton|Enables the Edit mode of the page@@AppEditButton"
>Edit</ng-container
>
</button>

请注意 >在新线路上。有没有其他人经历过同样的事情并有解决方案?

最佳答案

您应该设置 "htmlWhitespaceSensitivity": "ignore"在您项目的 .prettierrc 文件中。
https://prettier.io/docs/en/options.html#html-whitespace-sensitivity

关于visual-studio-code - VSCode Prettier 以一种奇怪的方式格式化 HTML(下一行大于符号),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53209320/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com