@markuplint/html-parser 5.0.0-rc.0 → 5.0.0-rc.2

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,18 @@
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.0.0-rc.2](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.1...v5.0.0-rc.2) (2026-04-15)
7
+
8
+ - build!: remove ESLint and replace with oxlint ([1e0a337](https://github.com/markuplint/markuplint/commit/1e0a337707f76b903b16beeeb8c4d4fc0d8fc9e4))
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ - ESLint is no longer used. Use oxlint instead.
13
+
14
+ # [5.0.0-rc.1](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.0...v5.0.0-rc.1) (2026-03-27)
15
+
16
+ **Note:** Version bump only for package @markuplint/html-parser
17
+
6
18
  # [5.0.0-rc.0](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.3...v5.0.0-rc.0) (2026-03-12)
7
19
 
8
20
  **Note:** Version bump only for package @markuplint/html-parser
@@ -12,6 +12,7 @@ export function optimizeStartsHeadTagOrBodyTagSetup(rawCode) {
12
12
  }
13
13
  const heads = [];
14
14
  const bodies = [];
15
+ // eslint-disable-next-line no-control-regex -- WHATWG HTML spec requires matching NULL character
15
16
  const code = rawCode.replaceAll(/(?<=<\/?)(?:head|body)(?=[\0\t\n\f />])/gi, tag => {
16
17
  const prefix = `x-${UNDUPLICATED_CHAR}`;
17
18
  let name;
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@markuplint/html-parser",
3
- "version": "5.0.0-rc.0",
3
+ "version": "5.0.0-rc.2",
4
4
  "description": "HTML parser for markuplint",
5
- "repository": "git@github.com:markuplint/markuplint.git",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/markuplint/markuplint.git",
8
+ "directory": "packages/@markuplint/html-parser"
9
+ },
6
10
  "author": "Yusuke Hirao <yusukehirao@me.com>",
7
11
  "license": "MIT",
8
12
  "engines": {
@@ -27,10 +31,10 @@
27
31
  "clean": "tsc --build --clean tsconfig.build.json"
28
32
  },
29
33
  "dependencies": {
30
- "@markuplint/ml-ast": "5.0.0-rc.0",
31
- "@markuplint/parser-utils": "5.0.0-rc.0",
34
+ "@markuplint/ml-ast": "5.0.0-rc.2",
35
+ "@markuplint/parser-utils": "5.0.0-rc.2",
32
36
  "parse5": "8.0.0",
33
- "type-fest": "5.4.4"
37
+ "type-fest": "5.5.0"
34
38
  },
35
- "gitHead": "ebf4d7cfca0c259aead3b292c6b8a202db4cd802"
39
+ "gitHead": "e43763858d9234c417053becc73dbd088c1e7ea6"
36
40
  }
@@ -1,12 +0,0 @@
1
- import type { NamespaceURI } from '@markuplint/ml-ast';
2
- /**
3
- * Determines the namespace URI for an element given its tag name and the parent's namespace.
4
- *
5
- * Uses parse5 to simulate parsing and determine whether a tag belongs to
6
- * the HTML, SVG, or MathML namespace within the given parent context.
7
- *
8
- * @param tagName - The element tag name to resolve
9
- * @param parentNamespace - The namespace URI of the parent element (defaults to XHTML)
10
- * @returns The resolved namespace URI for the tag
11
- */
12
- export declare function getNamespace(tagName: string, parentNamespace?: string): NamespaceURI;
@@ -1,41 +0,0 @@
1
- import { parse, parseFragment } from 'parse5';
2
- const DEFAULT_NAMESPACE = 'http://www.w3.org/1999/xhtml';
3
- /**
4
- * Determines the namespace URI for an element given its tag name and the parent's namespace.
5
- *
6
- * Uses parse5 to simulate parsing and determine whether a tag belongs to
7
- * the HTML, SVG, or MathML namespace within the given parent context.
8
- *
9
- * @param tagName - The element tag name to resolve
10
- * @param parentNamespace - The namespace URI of the parent element (defaults to XHTML)
11
- * @returns The resolved namespace URI for the tag
12
- */
13
- export function getNamespace(tagName, parentNamespace = DEFAULT_NAMESPACE) {
14
- switch (parentNamespace) {
15
- case 'http://www.w3.org/2000/svg':
16
- case 'http://www.w3.org/1998/Math/MathML': {
17
- const parent = parentNamespace === 'http://www.w3.org/2000/svg' ? 'svg' : 'math';
18
- const tag = `<${parent}><${tagName}></${parent}>`;
19
- const frag = parseFragment(tag);
20
- const node = frag.childNodes[0];
21
- if (!node) {
22
- return DEFAULT_NAMESPACE;
23
- }
24
- if ('namespaceURI' in node) {
25
- return node.namespaceURI;
26
- }
27
- return DEFAULT_NAMESPACE;
28
- }
29
- }
30
- const tag = `<${tagName}>`;
31
- const frag = parseFragment(tag);
32
- let node = frag.childNodes[0];
33
- if (!node) {
34
- const doc = parse(tag);
35
- node = doc.childNodes[0];
36
- }
37
- if (node && 'namespaceURI' in node) {
38
- return node.namespaceURI;
39
- }
40
- return DEFAULT_NAMESPACE;
41
- }