wx-minapp / minapp-vscode

WXML Language Support
https://marketplace.visualstudio.com/items?itemName=qiu8310.minapp-vscode
MIT License
262 stars 43 forks source link

image 格式化有问题 #61

Open JerryCjr opened 4 years ago

JerryCjr commented 4 years ago
prettyHtml format error: Void elements do not have end tags "image"
JerryCjr commented 4 years ago
    "minapp-vscode.wxmlFormatter": "prettyHtml",
    "minapp-vscode.prettyHtml": {
        "useTabs": false,
        "tabWidth": 2,
        "printWidth": 100,
        "singleQuote": false,
        "usePrettier": true,
        "wrapAttributes": false,
        "sortAttributes": false
    }
JerryCjr commented 4 years ago

wxml 内容

<view class='container'>
  <view class='test'>
    <image></image>
  </view>
</view>
JerryCjr commented 4 years ago

如果用这个配置的话 又会莫名其妙在html后面加一个分号

    "minapp-vscode.wxmlFormatter": "prettier",
    "minapp-vscode.prettier": {
        "parser": "html"
    },
iChenLei commented 3 years ago

最合理的还是针对wxml做一个prettier-wxml插件,prettyHtml和prettier都是针对标准HTML做处理的,wxml和标准HTML有不少差别