diff --git a/.changeset/tidy-carrots-repair.md b/.changeset/tidy-carrots-repair.md deleted file mode 100644 index 3e1a13f3..00000000 --- a/.changeset/tidy-carrots-repair.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"htmljs-parser": patch ---- - -Fix `isValidAttrValue` (and `isValidStatement` / `isValidScriptlet`) reporting `enclosed` for a value that ends in a trailing `//` line comment (e.g. `"hello" // note`). - -A line comment with no terminating newline consumes everything that would follow it on the line, so such a value is not safe to emit verbatim. It is now classified as `valid` (needs wrapping when placed inline), matching the existing behavior for an unguarded trailing newline. A comment guarded by a group (e.g. `("hello" // c\n)`) or a self-closing block comment (`"hello" /* c */`) still classifies as `enclosed`. diff --git a/CHANGELOG.md b/CHANGELOG.md index ea83e4a3..4e19c1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # htmljs-parser +## 5.12.1 + +### Patch Changes + +- [#227](https://github.com/marko-js/htmljs-parser/pull/227) [`a576b5c`](https://github.com/marko-js/htmljs-parser/commit/a576b5c86e1e7fe8a366784915361f50a9bdb381) Thanks [@DylanPiercey](https://github.com/DylanPiercey)! - Fix `isValidAttrValue` (and `isValidStatement` / `isValidScriptlet`) reporting `enclosed` for a value that ends in a trailing `//` line comment (e.g. `"hello" // note`). + + A line comment with no terminating newline consumes everything that would follow it on the line, so such a value is not safe to emit verbatim. It is now classified as `valid` (needs wrapping when placed inline), matching the existing behavior for an unguarded trailing newline. A comment guarded by a group (e.g. `("hello" // c\n)`) or a self-closing block comment (`"hello" /* c */`) still classifies as `enclosed`. + ## 5.12.0 ### Minor Changes diff --git a/package-lock.json b/package-lock.json index a401098b..bda61b7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "htmljs-parser", - "version": "5.12.0", + "version": "5.12.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "htmljs-parser", - "version": "5.12.0", + "version": "5.12.1", "license": "MIT", "devDependencies": { "@changesets/changelog-github": "^0.7.0", diff --git a/package.json b/package.json index 4171c34e..833700b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "htmljs-parser", - "version": "5.12.0", + "version": "5.12.1", "description": "An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values", "keywords": [ "HTML",