@pecot/visual-mcp 1.1.0 → 1.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/.claude-plugin/plugin.json +1 -1
- package/assets/slidev/deck-lint.config.js +2 -2
- package/assets/slidev/deck-lint.env.config.js +2 -2
- package/assets/slidev/package.json +7 -7
- package/assets/slidev/runtime/package.json +11 -11
- package/assets/slidev/scripts/eslint/_shared/dist/lib/drawio-geometry.js +10 -10
- package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.d.ts +2 -2
- package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.js +4 -4
- package/assets/slidev/scripts/eslint/_shared/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/_shared/lib/drawio-geometry.ts +10 -10
- package/assets/slidev/scripts/eslint/_shared/lib/text-measurer.ts +4 -4
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-content-before-frontmatter.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-marker-cell.js +4 -4
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-page.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-asset-prefix.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-filename-prefix.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-scaled-drawio.js +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-triple-hyphen-in-frontmatter.js +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-unknown-props.js +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/one-slide-per-file.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-matching-length.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-slides-entry.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/validate-clicks.js +7 -7
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-content-before-frontmatter.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-marker-cell.ts +4 -4
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-page.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-asset-prefix.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-filename-prefix.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-scaled-drawio.ts +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-triple-hyphen-in-frontmatter.ts +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-unknown-props.ts +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/one-slide-per-file.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-matching-length.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-slides-entry.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/validate-clicks.ts +7 -7
- package/assets/slidev/scripts/eslint/slidev-pages-lint/package.json +1 -1
- package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/max-chars.js +6 -6
- package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint-body.js +3 -3
- package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint.js +2 -2
- package/assets/slidev/scripts/eslint/text-constraints/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/text-constraints/lib/rules/max-chars.ts +6 -6
- package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint-body.ts +3 -3
- package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint.ts +2 -2
- package/assets/slidev/scripts/eslint/text-constraints/package.json +1 -1
- package/assets/slidev/scripts/eslint/validate-references/dist/index.js +1 -1
- package/assets/slidev/scripts/eslint/validate-references/dist/lib/schema-validator.js +1 -1
- package/assets/slidev/scripts/eslint/validate-references/dist/lib/semantic-validator.js +12 -12
- package/assets/slidev/scripts/eslint/validate-references/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/validate-references/index.ts +1 -1
- package/assets/slidev/scripts/eslint/validate-references/lib/schema-validator.ts +2 -2
- package/assets/slidev/scripts/eslint/validate-references/lib/semantic-validator.ts +12 -12
- package/assets/slidev/scripts/eslint/validate-references/package.json +1 -1
- package/cli/dist/cli.js +11 -10
- package/cli/dist/commands/chromium/host-dependencies.js +14 -7
- package/cli/dist/commands/drawio/export.js +27 -24
- package/cli/dist/commands/drawio/theme.js +8 -8
- package/cli/dist/commands/drawio/url.js +40 -32
- package/cli/dist/commands/evidence-xlsx/create.js +19 -18
- package/cli/dist/commands/pptx-ooxml/preview.js +26 -30
- package/cli/dist/commands/slidev-project/create.js +27 -26
- package/cli/dist/commands/slidev-project/linked-theme.js +5 -5
- package/cli/dist/commands/slidev-project/lint.js +29 -27
- package/cli/dist/commands/slidev-project/sync.js +35 -34
- package/cli/dist/commands/slidev-project/theme.js +19 -18
- package/cli/dist/commands/slidev-to-pptx/convert.d.ts +4 -0
- package/cli/dist/commands/slidev-to-pptx/convert.js +88 -75
- package/cli/dist/diagnostics.d.ts +38 -0
- package/cli/dist/diagnostics.js +46 -0
- package/cli/dist/domain/_shared/ports.d.ts +0 -1
- package/cli/dist/domain/_shared/text-check.js +2 -2
- package/cli/dist/domain/drawio/export.js +4 -4
- package/cli/dist/domain/drawio/label-text.js +1 -1
- package/cli/dist/domain/drawio/url.d.ts +11 -7
- package/cli/dist/domain/drawio/url.js +67 -45
- package/cli/dist/domain/evidence-xlsx/image-dimensions.js +14 -14
- package/cli/dist/domain/evidence-xlsx/spec-schema.js +26 -26
- package/cli/dist/domain/pptx-ooxml/merge.js +3 -3
- package/cli/dist/domain/pptx-ooxml/prerender-replace.d.ts +1 -0
- package/cli/dist/domain/pptx-ooxml/prerender-replace.js +3 -3
- package/cli/dist/domain/slidev-project/generated-files.d.ts +1 -1
- package/cli/dist/domain/slidev-project/generated-files.js +36 -36
- package/cli/dist/domain/slidev-project/initial-pages.js +4 -4
- package/cli/dist/domain/slidev-project/lint.js +11 -11
- package/cli/dist/domain/slidev-project/sync.js +13 -13
- package/cli/dist/domain/slidev-project/warnings.js +4 -4
- package/cli/dist/domain/slidev-theme/declaration.js +9 -9
- package/cli/dist/domain/slidev-theme/references.js +10 -10
- package/cli/dist/domain/slidev-theme/store-layout.js +6 -6
- package/cli/dist/domain/slidev-theme/talk-theme.js +13 -13
- package/cli/dist/domain/slidev-theme/theme-spec.js +5 -5
- package/cli/dist/domain/slidev-to-pptx/errors.js +3 -3
- package/cli/dist/infra/_shared/dependency-root.js +4 -4
- package/cli/dist/infra/_shared/patch-apply.js +6 -5
- package/cli/dist/infra/_shared/runtime-install.d.ts +12 -84
- package/cli/dist/infra/_shared/runtime-install.js +74 -108
- package/cli/dist/infra/_shared/slidev-bin.js +1 -1
- package/cli/dist/infra/drawio/icons.js +3 -3
- package/cli/dist/infra/drawio/pdf.js +1 -1
- package/cli/dist/infra/drawio/screenshot.js +10 -9
- package/cli/dist/infra/evidence-xlsx/workbook-writer.js +2 -2
- package/cli/dist/infra/playwright/chromium.js +4 -3
- package/cli/dist/infra/playwright/host-dependencies.js +8 -8
- package/cli/dist/infra/playwright/launch.js +5 -5
- package/cli/dist/infra/pptx-ooxml/soffice.js +2 -2
- package/cli/dist/infra/slidev-project/eslint-runner.js +10 -9
- package/cli/dist/infra/slidev-project/fs.js +6 -6
- package/cli/dist/infra/slidev-theme/store.js +18 -15
- package/cli/dist/infra/slidev-to-pptx/cache-store.js +6 -6
- package/cli/dist/infra/slidev-to-pptx/console-logger.d.ts +5 -5
- package/cli/dist/infra/slidev-to-pptx/console-logger.js +19 -20
- package/cli/dist/infra/slidev-to-pptx/dom-converter.d.ts +1 -1
- package/cli/dist/infra/slidev-to-pptx/dom-converter.js +12 -12
- package/cli/dist/infra/slidev-to-pptx/index.js +1 -9
- package/cli/dist/infra/slidev-to-pptx/pipeline.d.ts +2 -2
- package/cli/dist/infra/slidev-to-pptx/pipeline.js +56 -56
- package/cli/dist/infra/slidev-to-pptx/prerender-capture.js +14 -14
- package/cli/dist/infra/slidev-to-pptx/prerender.js +10 -10
- package/cli/dist/infra/slidev-to-pptx/runner.js +1 -0
- package/cli/dist/infra/slidev-to-pptx/scanner.js +10 -10
- package/cli/dist/infra/slidev-to-pptx/server.d.ts +2 -1
- package/cli/dist/infra/slidev-to-pptx/server.js +3 -3
- package/cli/dist/infra/slidev-to-pptx/single-pass-worker.js +39 -39
- package/cli/dist/infra/slidev-to-pptx/slide-worker.js +3 -3
- package/cli/dist/infra/slidev-to-pptx/visibility-helpers.js +8 -8
- package/cli/dist/mcp/dev-server-registry.js +10 -9
- package/cli/dist/mcp/queue.js +1 -1
- package/cli/dist/mcp/result.js +4 -4
- package/cli/dist/mcp/serve.js +5 -3
- package/cli/dist/mcp/server.js +2 -2
- package/cli/dist/mcp/tools/_shared.d.ts +1 -1
- package/cli/dist/mcp/tools/_shared.js +47 -38
- package/cli/dist/mcp/tools/drawio.js +23 -22
- package/cli/dist/mcp/tools/evidence.js +8 -8
- package/cli/dist/mcp/tools/setup.js +26 -26
- package/cli/dist/mcp/tools/slide-dev.js +20 -20
- package/cli/dist/mcp/tools/slide-page.js +39 -37
- package/cli/dist/mcp/tools/slide-theme.js +6 -6
- package/cli/dist/mcp/tools/slide.js +52 -50
- package/cli/dist/mcp/windows-path.js +8 -7
- package/cli/dist/node-runtime.d.ts +6 -1
- package/cli/dist/node-runtime.js +16 -8
- package/npm-shrinkwrap.json +46 -52
- package/package.json +6 -6
- package/vendor/text-rules/dist/source-hash +1 -1
|
@@ -38,8 +38,8 @@ export function defineDeckLintConfig({ referencesDirectories, panels, markerLayo
|
|
|
38
38
|
const isValid = Array.isArray(referencesDirectories) && isRecord(panels) && Array.isArray(markerLayouts) && isRecord(rules)
|
|
39
39
|
if (!isValid) {
|
|
40
40
|
throw new TypeError(
|
|
41
|
-
'defineDeckLintConfig
|
|
42
|
-
+ 'referencesDirectories
|
|
41
|
+
'invalid argument to defineDeckLintConfig '
|
|
42
|
+
+ '(fix: pass referencesDirectories and markerLayouts as arrays, and panels and rules as objects)',
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
const settings = { 'slidev-theme': { referencesDirectories, panels, markerLayouts } }
|
|
@@ -10,13 +10,13 @@ const ENV_NAME = 'PECOTV_DECK_LINT'
|
|
|
10
10
|
function readLintFromEnvironment() {
|
|
11
11
|
const text = process.env[ENV_NAME]
|
|
12
12
|
if (text === undefined || text === '') {
|
|
13
|
-
throw new Error(`${ENV_NAME}
|
|
13
|
+
throw new Error(`${ENV_NAME} is not set (fix: pass the lint value of slide theme --json as JSON)`)
|
|
14
14
|
}
|
|
15
15
|
try {
|
|
16
16
|
return JSON.parse(text)
|
|
17
17
|
}
|
|
18
18
|
catch (error) {
|
|
19
|
-
throw new Error(`${ENV_NAME}
|
|
19
|
+
throw new Error(`${ENV_NAME} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`)
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"@google/design.md": "0.4.0",
|
|
30
30
|
"@types/js-yaml": "^4.0.9",
|
|
31
31
|
"@types/node": "^22.20.5",
|
|
32
|
-
"c8": "^
|
|
33
|
-
"eslint": "^10.
|
|
32
|
+
"c8": "^12.0.0",
|
|
33
|
+
"eslint": "^10.14.0",
|
|
34
34
|
"eslint-config-prettier": "^10.1.8",
|
|
35
|
-
"eslint-plugin-vue": "^10.
|
|
36
|
-
"globals": "^17.
|
|
35
|
+
"eslint-plugin-vue": "^10.12.0",
|
|
36
|
+
"globals": "^17.14.0",
|
|
37
37
|
"jszip": "^3.10.2",
|
|
38
|
-
"playwright": "^1.
|
|
38
|
+
"playwright": "^1.65.0",
|
|
39
39
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
40
|
-
"typescript-eslint": "^8.72.
|
|
40
|
+
"typescript-eslint": "^8.72.1",
|
|
41
41
|
"typescript7": "npm:typescript@^7.0.2",
|
|
42
|
-
"vue-eslint-parser": "^10.4.
|
|
42
|
+
"vue-eslint-parser": "^10.4.2",
|
|
43
43
|
"yaml": "^2.9.1"
|
|
44
44
|
},
|
|
45
45
|
"nx": {
|
|
@@ -5,26 +5,26 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": true,
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"//peer-reason": "peer は slidev-theme-* の peerDependencies と同じ版に固定する。@slidev/* は
|
|
8
|
+
"//peer-reason": "peer は slidev-theme-* の peerDependencies と同じ版に固定する。@slidev/* は @slidev/cli と同じ版にする。",
|
|
9
9
|
"//override-reason": "overrides は root の pnpm-workspace.yaml の写し。lodash-es は overrides に置くと EOVERRIDE になる。",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@shikijs/langs": "4.
|
|
12
|
-
"@shikijs/themes": "4.
|
|
13
|
-
"@slidev/cli": "53.
|
|
14
|
-
"@slidev/client": "53.
|
|
11
|
+
"@shikijs/langs": "4.6.0",
|
|
12
|
+
"@shikijs/themes": "4.6.0",
|
|
13
|
+
"@slidev/cli": "53.1.0",
|
|
14
|
+
"@slidev/client": "53.1.0",
|
|
15
15
|
"@slidev/theme-default": "^0.25.0",
|
|
16
|
-
"@slidev/types": "53.
|
|
17
|
-
"@vueuse/core": "
|
|
16
|
+
"@slidev/types": "53.1.0",
|
|
17
|
+
"@vueuse/core": "15.0.0",
|
|
18
18
|
"dayjs": "1.11.23",
|
|
19
19
|
"html2canvas": "1.4.1",
|
|
20
20
|
"lodash-es": "4.18.1",
|
|
21
|
-
"shiki": "4.
|
|
21
|
+
"shiki": "4.6.0",
|
|
22
22
|
"uuid": "13.0.2",
|
|
23
|
-
"vite": "^8.3.
|
|
24
|
-
"vue": "3.5.
|
|
23
|
+
"vite": "^8.3.7",
|
|
24
|
+
"vue": "3.5.45"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"dom-to-pptx": "2.1.
|
|
27
|
+
"dom-to-pptx": "2.1.2"
|
|
28
28
|
},
|
|
29
29
|
"overrides": {
|
|
30
30
|
"dompurify": "^3.4.17",
|
|
@@ -127,7 +127,7 @@ function stripXmlComments(xml) {
|
|
|
127
127
|
*/
|
|
128
128
|
function scanCells(xml) {
|
|
129
129
|
if (typeof xml !== 'string' || xml.trim() === '') {
|
|
130
|
-
throw new DrawioGeometryError('empty-xml', 'draw.io
|
|
130
|
+
throw new DrawioGeometryError('empty-xml', 'draw.io XML is empty');
|
|
131
131
|
}
|
|
132
132
|
const source = stripXmlComments(xml);
|
|
133
133
|
const cells = [];
|
|
@@ -147,7 +147,7 @@ function scanCells(xml) {
|
|
|
147
147
|
if (closing) {
|
|
148
148
|
const top = stack.pop();
|
|
149
149
|
if (top?.name === 'diagram' && !top.hasChild && between.trim() !== '') {
|
|
150
|
-
throw new DrawioGeometryError('compressed', '
|
|
150
|
+
throw new DrawioGeometryError('compressed', 'compressed <diagram> is not supported (fix: turn off File > Properties > Compressed in draw.io and save)');
|
|
151
151
|
}
|
|
152
152
|
if (name === 'mxCell')
|
|
153
153
|
current = null;
|
|
@@ -161,12 +161,12 @@ function scanCells(xml) {
|
|
|
161
161
|
if (parent)
|
|
162
162
|
parent.hasChild = true;
|
|
163
163
|
if (name === 'object' || name === 'UserObject') {
|
|
164
|
-
throw new DrawioGeometryError('wrapped-cell',
|
|
164
|
+
throw new DrawioGeometryError('wrapped-cell', `cell wrapped in <${name}> is not supported; it is generated when a cell has properties or a link (fix: remove the properties so the cell is a plain mxCell)`);
|
|
165
165
|
}
|
|
166
166
|
if (name === 'diagram') {
|
|
167
167
|
diagramCount += 1;
|
|
168
168
|
if (diagramCount > 1) {
|
|
169
|
-
throw new DrawioGeometryError('multi-page', '
|
|
169
|
+
throw new DrawioGeometryError('multi-page', 'multi-page draw.io file is not supported (fix: use a file with one page)');
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
if (name === 'mxGraphModel')
|
|
@@ -219,7 +219,7 @@ function scanCells(xml) {
|
|
|
219
219
|
stack.push({ name, hasChild: false });
|
|
220
220
|
}
|
|
221
221
|
if (modelCount === 0) {
|
|
222
|
-
throw new DrawioGeometryError('no-model', 'draw.io
|
|
222
|
+
throw new DrawioGeometryError('no-model', 'draw.io XML has no <mxGraphModel>');
|
|
223
223
|
}
|
|
224
224
|
return cells;
|
|
225
225
|
}
|
|
@@ -332,20 +332,20 @@ export function parseDrawio(xml) {
|
|
|
332
332
|
export function resolveCellRect(model, cellId) {
|
|
333
333
|
const cell = model.byId.get(cellId);
|
|
334
334
|
if (!cell) {
|
|
335
|
-
throw new DrawioGeometryError('unknown-cell',
|
|
335
|
+
throw new DrawioGeometryError('unknown-cell', `cell not found in the diagram: ${cellId}`);
|
|
336
336
|
}
|
|
337
337
|
if (cell.edge) {
|
|
338
|
-
throw new DrawioGeometryError('edge-cell',
|
|
338
|
+
throw new DrawioGeometryError('edge-cell', `cell is an edge: ${cellId} (fix: give the ID of a vertex for the marker)`);
|
|
339
339
|
}
|
|
340
340
|
if (!cell.vertex) {
|
|
341
|
-
throw new DrawioGeometryError('not-vertex',
|
|
341
|
+
throw new DrawioGeometryError('not-vertex', `cell is not a vertex, such as a layer: ${cellId} (fix: give the ID of a vertex)`);
|
|
342
342
|
}
|
|
343
343
|
if (model.isHidden(cell)) {
|
|
344
|
-
throw new DrawioGeometryError('hidden-cell',
|
|
344
|
+
throw new DrawioGeometryError('hidden-cell', `cell is hidden (visible="0"): ${cellId}`);
|
|
345
345
|
}
|
|
346
346
|
const rect = model.vertexRect(cell);
|
|
347
347
|
if (!rect) {
|
|
348
|
-
throw new DrawioGeometryError('relative-cell',
|
|
348
|
+
throw new DrawioGeometryError('relative-cell', `cell is placed relative to its parent (relative="1"), so its position cannot be determined: ${cellId}`);
|
|
349
349
|
}
|
|
350
350
|
return { ...rect, crisp: crispOffsetOf(strokeOf(cell.style).width) };
|
|
351
351
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare function stripHtmlTags(text: string): string;
|
|
2
2
|
export declare function isFullWidth(codePoint: number): boolean;
|
|
3
3
|
export declare function fullWidthEquivalent(text: string): number;
|
|
4
|
-
export declare const BOLD_REQUIRED_MESSAGE = "
|
|
4
|
+
export declare const BOLD_REQUIRED_MESSAGE = "no bold emphasis on the key point (fix: wrap only the key point in <strong>\u2026</strong>; wrapping the whole text is not emphasis; <b> and Markdown ** are not allowed)";
|
|
5
5
|
export declare function hasBoldEmphasis(text: string): boolean;
|
|
6
|
-
export declare const EM_DISALLOWED_MESSAGE = "<em>
|
|
6
|
+
export declare const EM_DISALLOWED_MESSAGE = "<em> is not allowed; use <strong> for emphasis only (fix: remove <em> and keep the words)";
|
|
7
7
|
export declare function hasDisallowedEmTag(text: string): boolean;
|
|
8
8
|
export interface TextConstraint {
|
|
9
9
|
min_chars?: number;
|
|
@@ -29,7 +29,7 @@ export function fullWidthEquivalent(text) {
|
|
|
29
29
|
// 太字強調は <strong> のみを認める(テンプレートの強調規範を <strong> に一本化しており <b> は不可)。
|
|
30
30
|
// 属性付き・大文字タグは許容し、中身が空の <strong></strong> は強調とみなさない。
|
|
31
31
|
const STRONG_TAG_PATTERN = /<strong(?:\s[^>]*)?>([\s\S]*?)<\/strong\s*>/gi;
|
|
32
|
-
export const BOLD_REQUIRED_MESSAGE = '
|
|
32
|
+
export const BOLD_REQUIRED_MESSAGE = 'no bold emphasis on the key point (fix: wrap only the key point in <strong>…</strong>; wrapping the whole text is not emphasis; <b> and Markdown ** are not allowed)';
|
|
33
33
|
// 全文が strong に覆われていると強調の対比が消えるため、強調とみなさない。
|
|
34
34
|
// 複数の strong で分割して全文を覆うケースも同じ扱いにする。
|
|
35
35
|
export function hasBoldEmphasis(text) {
|
|
@@ -49,7 +49,7 @@ export function hasBoldEmphasis(text) {
|
|
|
49
49
|
}
|
|
50
50
|
// <em> は強調記法として不可(強調は <strong> のみ)。属性付き・大文字タグも検出する。
|
|
51
51
|
const EM_TAG_PATTERN = /<em(?:\s[^>]*)?>/i;
|
|
52
|
-
export const EM_DISALLOWED_MESSAGE = '<em>
|
|
52
|
+
export const EM_DISALLOWED_MESSAGE = '<em> is not allowed; use <strong> for emphasis only (fix: remove <em> and keep the words)';
|
|
53
53
|
export function hasDisallowedEmTag(text) {
|
|
54
54
|
if (typeof text !== 'string') {
|
|
55
55
|
return false;
|
|
@@ -67,7 +67,7 @@ export function validateText(text, constraint) {
|
|
|
67
67
|
if (minChars != null && fwe < minChars) {
|
|
68
68
|
errors.push({
|
|
69
69
|
type: 'minChars',
|
|
70
|
-
message: `${fwe}
|
|
70
|
+
message: `${fwe} chars (min: ${minChars})`,
|
|
71
71
|
actual: fwe,
|
|
72
72
|
limit: minChars,
|
|
73
73
|
});
|
|
@@ -76,7 +76,7 @@ export function validateText(text, constraint) {
|
|
|
76
76
|
if (maxChars != null && fwe > maxChars) {
|
|
77
77
|
errors.push({
|
|
78
78
|
type: 'maxChars',
|
|
79
|
-
message: `${fwe}
|
|
79
|
+
message: `${fwe} chars (max: ${maxChars})`,
|
|
80
80
|
actual: fwe,
|
|
81
81
|
limit: maxChars,
|
|
82
82
|
});
|