@diplodoc/cli-tests 5.12.0 → 5.12.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/e2e/__snapshots__/alternates.test.ts.snap +18 -27
- package/e2e/__snapshots__/bundles.spec.ts.snap +3 -3
- package/e2e/__snapshots__/include-toc.test.ts.snap +0 -13
- package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +6 -9
- package/e2e/__snapshots__/metadata.spec.ts.snap +3 -6
- package/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
- package/e2e/__snapshots__/preprocess.test.ts.snap +297 -63
- package/e2e/__snapshots__/regression.test.ts.snap +18 -36
- package/e2e/__snapshots__/restricted-access.test.ts.snap +0 -10
- package/e2e/__snapshots__/rtl.spec.ts.snap +6 -6
- package/e2e/__snapshots__/search.test.ts.snap +1 -1
- package/e2e/__snapshots__/single-page.spec.ts.snap +3 -3
- package/e2e/__snapshots__/skip-html-extension.spec.ts.snap +4 -4
- package/e2e/__snapshots__/translation.spec.ts.snap +0 -10
- package/e2e/alternates.test.ts +1 -0
- package/e2e/bundles.spec.ts +1 -0
- package/e2e/errors.spec.ts +18 -8
- package/e2e/generate-map.spec.ts +6 -2
- package/e2e/include-toc.test.ts +1 -0
- package/e2e/load-custom-resources.spec.ts +1 -0
- package/e2e/metadata.spec.ts +1 -0
- package/e2e/plugin-corner-cases.spec.ts +1 -0
- package/e2e/preprocess.test.ts +8 -5
- package/e2e/redirects-validation.spec.ts +5 -4
- package/e2e/regression.test.ts +1 -0
- package/e2e/restricted-access.test.ts +3 -5
- package/e2e/rtl.spec.ts +1 -0
- package/e2e/search.test.ts +1 -0
- package/e2e/single-page.spec.ts +1 -0
- package/e2e/skip-html-extension.spec.ts +1 -0
- package/e2e/translation.spec.ts +17 -6
- package/fixtures/cliAdapter.ts +7 -3
- package/fixtures/globals.d.ts +1 -1
- package/fixtures/runners/binary.ts +5 -2
- package/fixtures/runners/index.ts +2 -1
- package/fixtures/runners/source.ts +1 -1
- package/fixtures/utils/file.ts +20 -16
- package/fixtures/utils/test.ts +19 -19
- package/mocks/preprocess/input/autotitle.md +3 -0
- package/mocks/preprocess/input/includes/level1.md +9 -0
- package/mocks/preprocess/input/includes/level11.md +1 -0
- package/mocks/preprocess/input/includes/sub/level2.md +7 -0
- package/mocks/preprocess/input/level0.md +7 -0
- package/mocks/preprocess/input/level1/level1.md +7 -0
- package/mocks/preprocess/input/level1/level2/level2.md +6 -0
- package/mocks/preprocess/input/level1/toc.yaml +5 -0
- package/mocks/preprocess/input/toc.yaml +8 -0
- package/package.json +1 -1
package/fixtures/utils/test.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
|
|
2
1
|
import assets from '@diplodoc/cli/manifest';
|
|
3
2
|
|
|
4
3
|
export function platformless(text: string): string {
|
|
5
4
|
let index = 1;
|
|
6
5
|
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
return (
|
|
7
|
+
hashless(text)
|
|
8
|
+
.replace(/\r\n/g, '\n')
|
|
9
|
+
// Fix for XML equiv-text attributes in Windows - handle various patterns
|
|
10
|
+
.replace(/equiv-text="[\r\n]+ "/g, 'equiv-text=" "')
|
|
11
|
+
.replace(/equiv-text="[\r\n]+
"/g, 'equiv-text="
"')
|
|
12
|
+
// Also normalize any other attributes that might have line ending issues
|
|
13
|
+
.replace(/(ctype|id)="[\r\n]+(.*?)"/g, '$1="$2"')
|
|
14
|
+
.replace(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/g, 'UUID')
|
|
15
|
+
.replace(
|
|
16
|
+
/(content"?[:=]{1}[" ]{1}Diplodoc.*? )v\d+\.\d+\.\d+(?:-[\w-]+)?/g,
|
|
17
|
+
`$1vDIPLODOC-VERSION`,
|
|
18
|
+
)
|
|
19
|
+
.replace(/(\\(?![/"'])){1,2}/g, '/')
|
|
20
|
+
.replace(
|
|
21
|
+
/id=\\"inline-code-id-[a-zA-Z0-9]{8}\\"/g,
|
|
22
|
+
() => `id="inline-code-id-${index++}"`,
|
|
23
|
+
)
|
|
24
|
+
);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export function hashless(text: string): string {
|
|
@@ -45,4 +46,3 @@ export function bundleless(text: string): string {
|
|
|
45
46
|
|
|
46
47
|
return text;
|
|
47
48
|
}
|
|
48
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Level 11 svg header 
|