@markuplint/rules 4.0.0-alpha.5 → 4.0.0-alpha.7

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2023 Yusuke Hirao
3
+ Copyright (c) 2017-2024 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -3,7 +3,7 @@ import { start } from './start.js';
3
3
  export function contentModel(
4
4
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
5
5
  el, rules, options) {
6
- const model = createModel(el, rules);
6
+ const { model, specs } = createModel(el, rules);
7
7
  if (model == null) {
8
8
  return [
9
9
  {
@@ -14,7 +14,7 @@ el, rules, options) {
14
14
  },
15
15
  ];
16
16
  }
17
- const result = start(model, el, el.ownerMLDocument.specs, options);
17
+ const result = start(model, el, specs, options);
18
18
  return result;
19
19
  }
20
20
  function createModel(
@@ -22,7 +22,10 @@ function createModel(
22
22
  el, rules) {
23
23
  const specs = cachedSpecs(el.ownerMLDocument.specs, rules);
24
24
  const model = getContentModel(el, specs.specs);
25
- return model;
25
+ return {
26
+ model,
27
+ specs,
28
+ };
26
29
  }
27
30
  const caches = new Map();
28
31
  function cachedSpecs(specs, rules) {
@@ -1,5 +1,5 @@
1
- /// <reference types="debug" />
2
- export declare const cmLog: import("debug").Debugger;
1
+ import type { Log } from '../debug.js';
2
+ export declare const cmLog: Log;
3
3
  export declare const bgGreen: {
4
4
  (): void;
5
5
  bold(): void;
@@ -1,6 +1,6 @@
1
- /// <reference types="debug" />
1
+ import type { Log } from '../debug.js';
2
2
  import color from 'ansi-colors';
3
- export declare const cmLog: import("debug").Debugger;
3
+ export declare const cmLog: Log;
4
4
  export declare const bgGreen: color.StyleFunction;
5
5
  export declare const green: color.StyleFunction;
6
6
  export declare const bgRed: color.StyleFunction;
@@ -7,9 +7,6 @@ export default createRule({
7
7
  },
8
8
  async verify({ document, report, t }) {
9
9
  await document.walkOn('Element', el => {
10
- if (el.pretenderContext?.type === 'pretender') {
11
- return;
12
- }
13
10
  if (accnameMayBeMutable(el, document)) {
14
11
  return;
15
12
  }
@@ -5,32 +5,32 @@ export default createRule({
5
5
  /**
6
6
  * @see https://en.wikipedia.org/wiki/Bullet_(typography)#In_Unicode
7
7
  */
8
- '\u2022',
9
- '\u2023',
10
- '\u2043',
11
- '\u204C',
12
- '\u204D',
13
- '\u2219',
14
- '\u25CB',
15
- '\u25CF',
16
- '\u25D8',
17
- '\u25E6',
18
- '\u2619',
19
- '\u2765',
20
- '\u2767',
21
- '\u29BE',
22
- '\u29BF',
8
+ '\u2022', // • BULLET (HTML &#8226; · &bull;, &bullet;)
9
+ '\u2023', // ‣ TRIANGULAR BULLET (HTML &#8227;)
10
+ '\u2043', // ⁃ HYPHEN BULLET (HTML &#8259; · &hybull;)
11
+ '\u204C', // ⁌ BLACK LEFTWARDS BULLET (HTML &#8268;)
12
+ '\u204D', // ⁍ BLACK RIGHTWARDS BULLET (HTML &#8269;)
13
+ '\u2219', // ∙ BULLET OPERATOR (HTML &#8729;) for use in mathematical notation primarily as a dot product instead of interupt.
14
+ '\u25CB', // ○ WHITE CIRCLE (HTML &#9675; · &cir;)
15
+ '\u25CF', // ● BLACK CIRCLE (HTML &#9679;)
16
+ '\u25D8', // ◘ INVERSE BULLET (HTML &#9688;)
17
+ '\u25E6', // ◦ WHITE BULLET (HTML &#9702;)
18
+ '\u2619', // ☙ REVERSED ROTATED FLORAL HEART BULLET (HTML &#9753;); see Fleuron (typography)
19
+ '\u2765', // ❥ ROTATED HEAVY BLACK HEART BULLET (HTML &#10085;)
20
+ '\u2767', // ❧ ROTATED FLORAL HEART BULLET (HTML &#10087;); see Fleuron (typography)
21
+ '\u29BE', // ⦾ CIRCLED WHITE BULLET (HTML &#10686; · &olcir;)
22
+ '\u29BF', // ⦿ CIRCLED BULLET (HTML &#10687; · &ofcir;)
23
23
  /**
24
24
  * In Japanese
25
25
  * @see https://ja.wikipedia.org/wiki/中黒#符号位置
26
26
  */
27
- '\u00B7',
28
- '\u0387',
29
- '\u2022',
30
- '\u2219',
31
- '\u22C5',
32
- '\u30FB',
33
- '\uFF65',
27
+ '\u00B7', // MIDDLE DOT
28
+ '\u0387', // GREEK ANO TELIA
29
+ '\u2022', // BULLET
30
+ '\u2219', // BULLET OPERATOR
31
+ '\u22C5', // DOT OPERATOR
32
+ '\u30FB', // KATAKANA MIDDLE DOT
33
+ '\uFF65', // HALFWIDTH KATAKANA MIDDLE DOT
34
34
  /**
35
35
  * In Other Languages
36
36
  */
@@ -38,8 +38,8 @@ export default createRule({
38
38
  /**
39
39
  * From Markdown
40
40
  */
41
- '-',
42
- '*',
41
+ '-', // dashes
42
+ '*', // asterisks
43
43
  '+', // plus signs
44
44
  ],
45
45
  defaultOptions: {
@@ -47,8 +47,8 @@ export default createRule({
47
47
  /**
48
48
  * From Markdown
49
49
  */
50
- '-',
51
- '*',
50
+ '-', // dashes
51
+ '*', // asterisks
52
52
  '+', // plus signs
53
53
  ],
54
54
  noPrev: true,
@@ -75,7 +75,7 @@ export const checkingRequiredOwnedElements = ({ el, role }) => t => {
75
75
  if (mayBeBeforeCreated(el)) {
76
76
  return {
77
77
  scope: el,
78
- message: t('{0}. Or, {1}', t('require {0}', role.requiredOwnedElements.length === 1 && role.requiredOwnedElements[0]
78
+ message: t('{0}. Or, {1}', t('{0} requires {1}', t('the {0}', 'child element'), role.requiredOwnedElements.length === 1 && role.requiredOwnedElements[0]
79
79
  ? t('the "{0*}" {1}', role.requiredOwnedElements[0], 'role')
80
80
  : t('the {0}', 'roles') + `: ${t(role.requiredOwnedElements)}`), t('require {0}', 'aria-busy="true"')),
81
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "4.0.0-alpha.5",
3
+ "version": "4.0.0-alpha.7",
4
4
  "description": "Built-in rules of markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -25,18 +25,18 @@
25
25
  "./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
26
26
  },
27
27
  "dependencies": {
28
- "@markuplint/html-spec": "4.0.0-alpha.5",
29
- "@markuplint/ml-core": "4.0.0-alpha.5",
30
- "@markuplint/ml-spec": "4.0.0-alpha.5",
31
- "@markuplint/selector": "4.0.0-alpha.5",
32
- "@markuplint/shared": "4.0.0-alpha.5",
33
- "@markuplint/types": "4.0.0-alpha.5",
34
- "@types/debug": "^4.1.10",
28
+ "@markuplint/html-spec": "4.0.0-alpha.7",
29
+ "@markuplint/ml-core": "4.0.0-alpha.7",
30
+ "@markuplint/ml-spec": "4.0.0-alpha.7",
31
+ "@markuplint/selector": "4.0.0-alpha.7",
32
+ "@markuplint/shared": "4.0.0-alpha.7",
33
+ "@markuplint/types": "4.0.0-alpha.7",
34
+ "@types/debug": "^4.1.12",
35
35
  "@ungap/structured-clone": "^1.2.0",
36
36
  "ansi-colors": "^4.1.3",
37
- "chrono-node": "^2.7.0",
37
+ "chrono-node": "^2.7.4",
38
38
  "debug": "^4.3.4",
39
- "type-fest": "^4.5.0"
39
+ "type-fest": "^4.9.0"
40
40
  },
41
- "gitHead": "0c3e4690662edf1765bcc4b6411ec5507c1e2ea3"
41
+ "gitHead": "571129bf6498541125e1e7c3907d5ed9af53459a"
42
42
  }