Skip to content

Commit

Permalink
chore: improve prettyHtml compatibility with wxml (#128)
Browse files Browse the repository at this point in the history
* chore: improve prettyHtml compatibility with wxml

* chore: add changelog
  • Loading branch information
iChenLei authored Dec 4, 2021
1 parent 9b653b1 commit b406948
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.4.4 / 2021-12-04
==================

* 更改`prettyHtml`源代码以提高与wxml的兼容性,修复一些与之相关的format错误

2.4.3 / 2021-11-16
==================

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "minapp-vscode",
"displayName": "WXML - Language Service",
"description": "wechat miniprogram .wxml file syntax highlight,code autocomplete(support native miniprogram、mpvue and wepy framework,provide code snippets)",
"version": "2.4.3",
"version": "2.4.4",
"publisher": "qiu8310",
"extensionKind": [
"workspace"
Expand Down
62 changes: 31 additions & 31 deletions res/prettyhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -4088,14 +4088,14 @@
if (this._getParentElement()) {
this._getParentElement().endSourceSpan = endTagToken.sourceSpan;
}
if (this.getTagDefinition(nameInfo.fullName, this.options.ignoreFirstLf, this.options.selfClosingElements)
.isVoid) {
this._errors.push(TreeError.create(nameInfo.fullName, endTagToken.sourceSpan, `Void elements do not have end tags "${endTagToken.parts[1]}"`));
}
else if (!this._popElement(nameInfo.fullName)) {
const errMsg = `Unexpected closing tag "${nameInfo.fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;
this._errors.push(TreeError.create(nameInfo.fullName, endTagToken.sourceSpan, errMsg));
}
// if (this.getTagDefinition(nameInfo.fullName, this.options.ignoreFirstLf, this.options.selfClosingElements)
// .isVoid) {
// this._errors.push(TreeError.create(nameInfo.fullName, endTagToken.sourceSpan, `Void elements do not have end tags "${endTagToken.parts[1]}"`));
// }
// else if (!this._popElement(nameInfo.fullName)) {
// const errMsg = `Unexpected closing tag "${nameInfo.fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;
// this._errors.push(TreeError.create(nameInfo.fullName, endTagToken.sourceSpan, errMsg));
// }
}
_popElement(fullName) {
for (let stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {
Expand Down Expand Up @@ -5432,29 +5432,29 @@

},{}],59:[function(require,module,exports){
module.exports=[
"area",
"base",
"basefont",
"bgsound",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"image",
"img",
"input",
"isindex",
"keygen",
"link",
"menuitem",
"meta",
"nextid",
"param",
"source",
"track",
"wbr"
// "area",
// "base",
// "basefont",
// "bgsound",
// "br",
// "col",
// "command",
// "embed",
// "frame",
// "hr",
// "image",
// "img",
// "input",
// "isindex",
// "keygen",
// "link",
// "menuitem",
// "meta",
// "nextid",
// "param",
// "source",
// "track",
// "wbr"
]

},{}],60:[function(require,module,exports){
Expand Down

0 comments on commit b406948

Please sign in to comment.