@markuplint/html-parser 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.3.0](https://github.com/markuplint/markuplint/compare/v5.2.0...v5.3.0) (2026-10-21)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **html-parser:** treat xmp content as RAWTEXT ([cbf0d18](https://github.com/markuplint/markuplint/commit/cbf0d181dc64b44a885fbe32e961304548fe708b)), closes [#4180](https://github.com/markuplint/markuplint/issues/4180)
11
+ * make published packages loadable from require() and put types first ([723106f](https://github.com/markuplint/markuplint/commit/723106f51aac4e60dc02db2c1a894617368b0253)), closes [#4198](https://github.com/markuplint/markuplint/issues/4198)
12
+
13
+
6
14
  # [5.2.0](https://github.com/markuplint/markuplint/compare/v5.1.1...v5.2.0) (2026-10-13)
7
15
 
8
16
  ### Bug Fixes
package/lib/parser.d.ts CHANGED
@@ -19,6 +19,14 @@ type ExtendsOptions = Pick<ParserOptions, 'ignoreTags' | 'maskChar'>;
19
19
  * and optimizations for `<head>` / `<body>` tag handling.
20
20
  */
21
21
  export declare class HtmlParser extends Parser<Node, State> {
22
+ /**
23
+ * `xmp` is RAWTEXT in HTML, so its content must not be re-tokenized as
24
+ * markup; a literal `</head>` there is plain text (#4180). It is listed here
25
+ * rather than in the `Parser` default because Vue/Svelte/JSX treat
26
+ * `Xmp`/`xmp` as an ordinary element whose children are parsed.
27
+ *
28
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#rawtext-state
29
+ */
22
30
  constructor(options?: ExtendsOptions);
23
31
  /**
24
32
  * `documentMode: 'auto'` (default) decides document vs. fragment via
package/lib/parser.js CHANGED
@@ -9,8 +9,16 @@ import { getEndPosition } from '@markuplint/parser-utils/location';
9
9
  * and optimizations for `<head>` / `<body>` tag handling.
10
10
  */
11
11
  export class HtmlParser extends Parser {
12
+ /**
13
+ * `xmp` is RAWTEXT in HTML, so its content must not be re-tokenized as
14
+ * markup; a literal `</head>` there is plain text (#4180). It is listed here
15
+ * rather than in the `Parser` default because Vue/Svelte/JSX treat
16
+ * `Xmp`/`xmp` as an ordinary element whose children are parsed.
17
+ *
18
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#rawtext-state
19
+ */
12
20
  constructor(options) {
13
- super(options, {
21
+ super({ ...options, rawTextElements: ['style', 'script', 'xmp'] }, {
14
22
  startsHeadTagOrBodyTag: null,
15
23
  afterPosition: {
16
24
  endOffset: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/html-parser",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "HTML parser for markuplint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "import": "./lib/index.js",
19
- "types": "./lib/index.d.ts"
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
20
20
  }
21
21
  },
22
22
  "publishConfig": {
@@ -31,10 +31,10 @@
31
31
  "clean": "tsc --build --clean tsconfig.build.json"
32
32
  },
33
33
  "dependencies": {
34
- "@markuplint/ml-ast": "5.1.1",
35
- "@markuplint/parser-utils": "5.2.0",
34
+ "@markuplint/ml-ast": "5.3.0",
35
+ "@markuplint/parser-utils": "5.3.0",
36
36
  "parse5": "^8.0.1",
37
37
  "type-fest": "^5.10.0"
38
38
  },
39
- "gitHead": "d8b2feab77c9c862513615bea6b80d2817431878"
39
+ "gitHead": "f587cf0206c8426e57369a48d6d5fb22306eafde"
40
40
  }