@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.
Files changed (48) hide show
  1. package/e2e/__snapshots__/alternates.test.ts.snap +18 -27
  2. package/e2e/__snapshots__/bundles.spec.ts.snap +3 -3
  3. package/e2e/__snapshots__/include-toc.test.ts.snap +0 -13
  4. package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +6 -9
  5. package/e2e/__snapshots__/metadata.spec.ts.snap +3 -6
  6. package/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
  7. package/e2e/__snapshots__/preprocess.test.ts.snap +297 -63
  8. package/e2e/__snapshots__/regression.test.ts.snap +18 -36
  9. package/e2e/__snapshots__/restricted-access.test.ts.snap +0 -10
  10. package/e2e/__snapshots__/rtl.spec.ts.snap +6 -6
  11. package/e2e/__snapshots__/search.test.ts.snap +1 -1
  12. package/e2e/__snapshots__/single-page.spec.ts.snap +3 -3
  13. package/e2e/__snapshots__/skip-html-extension.spec.ts.snap +4 -4
  14. package/e2e/__snapshots__/translation.spec.ts.snap +0 -10
  15. package/e2e/alternates.test.ts +1 -0
  16. package/e2e/bundles.spec.ts +1 -0
  17. package/e2e/errors.spec.ts +18 -8
  18. package/e2e/generate-map.spec.ts +6 -2
  19. package/e2e/include-toc.test.ts +1 -0
  20. package/e2e/load-custom-resources.spec.ts +1 -0
  21. package/e2e/metadata.spec.ts +1 -0
  22. package/e2e/plugin-corner-cases.spec.ts +1 -0
  23. package/e2e/preprocess.test.ts +8 -5
  24. package/e2e/redirects-validation.spec.ts +5 -4
  25. package/e2e/regression.test.ts +1 -0
  26. package/e2e/restricted-access.test.ts +3 -5
  27. package/e2e/rtl.spec.ts +1 -0
  28. package/e2e/search.test.ts +1 -0
  29. package/e2e/single-page.spec.ts +1 -0
  30. package/e2e/skip-html-extension.spec.ts +1 -0
  31. package/e2e/translation.spec.ts +17 -6
  32. package/fixtures/cliAdapter.ts +7 -3
  33. package/fixtures/globals.d.ts +1 -1
  34. package/fixtures/runners/binary.ts +5 -2
  35. package/fixtures/runners/index.ts +2 -1
  36. package/fixtures/runners/source.ts +1 -1
  37. package/fixtures/utils/file.ts +20 -16
  38. package/fixtures/utils/test.ts +19 -19
  39. package/mocks/preprocess/input/autotitle.md +3 -0
  40. package/mocks/preprocess/input/includes/level1.md +9 -0
  41. package/mocks/preprocess/input/includes/level11.md +1 -0
  42. package/mocks/preprocess/input/includes/sub/level2.md +7 -0
  43. package/mocks/preprocess/input/level0.md +7 -0
  44. package/mocks/preprocess/input/level1/level1.md +7 -0
  45. package/mocks/preprocess/input/level1/level2/level2.md +6 -0
  46. package/mocks/preprocess/input/level1/toc.yaml +5 -0
  47. package/mocks/preprocess/input/toc.yaml +8 -0
  48. package/package.json +1 -1
@@ -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 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
- )
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
-
@@ -29,6 +29,9 @@ Reference link with hash
29
29
  [link]: ./mermaid.md
30
30
  [link-with-hash]: ./1.md#subtitle
31
31
 
32
+ Link another level
33
+ [{#T}](./includes/level11.md)
34
+
32
35
  ## Header {#header}
33
36
 
34
37
  Content
@@ -0,0 +1,9 @@
1
+ # Level 1 svg header in includes ![Level 1 svg header in includes](../_assets/1.svg)
2
+
3
+ [{#T}](../level1/level1.md)
4
+
5
+ [{#T}](../level1/level2/level2.md)
6
+
7
+ {% include [{#T}](level2/level2.md) %}
8
+
9
+ [{#T}](level11.md)
@@ -0,0 +1 @@
1
+ # Level 11 svg header ![Level 11 svg header](../_assets/1.svg)
@@ -0,0 +1,7 @@
1
+ # Level 2 svg header ![Level 2 svg header](../../_assets/1.svg)
2
+
3
+ [{#T}](../level1.md)
4
+
5
+ [{#T}](../../level0.md)
6
+
7
+ [{#T}](../../level1/level1.md)
@@ -0,0 +1,7 @@
1
+ # Level root svg header ![Level root svg header](_assets/1.svg)
2
+
3
+ [{#T}](images.md)
4
+
5
+ [{#T}](level1/level1.md)
6
+
7
+ [{#T}](level1/level2/level2.md)
@@ -0,0 +1,7 @@
1
+ # Level 1 svg header ![Level 1 svg header](../_assets/1.svg)
2
+
3
+ [{#T}](../level0.md)
4
+
5
+ [{#T}](level2/level2.md)
6
+
7
+ [{#T}](../includes/level11.md)
@@ -0,0 +1,6 @@
1
+ # Level 2 svg header ![Level 2 svg header](../../_assets/1.svg)
2
+
3
+ [{#T}](../level1.md)
4
+
5
+ [{#T}](../../level0.md)
6
+
@@ -0,0 +1,5 @@
1
+ items:
2
+ - name: level1
3
+ href: ./level1
4
+ - name: level2
5
+ href: ./level2/level2
@@ -14,3 +14,11 @@ items:
14
14
  href: ./autotitle
15
15
  - name: includes
16
16
  href: ./includes
17
+ - name: level11
18
+ href: ./includes/level11
19
+ - name: level0
20
+ href: ./level0
21
+ - name: level1
22
+ href: ./level1/level1
23
+ - name: level2
24
+ href: ./level1/level2/level2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.12.0",
3
+ "version": "5.12.2",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },