@diplodoc/cli-tests 5.39.7 → 5.40.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.
Files changed (34) hide show
  1. package/e2e/__snapshots__/include-toc.test.ts.snap +23 -50
  2. package/e2e/__snapshots__/includes-conditions.test.ts.snap +15 -29
  3. package/e2e/__snapshots__/includes.test.ts.snap +437 -147
  4. package/e2e/__snapshots__/merge-includes.spec.ts.snap +400 -1
  5. package/e2e/__snapshots__/pdf-page.spec.ts.snap +0 -1
  6. package/e2e/__snapshots__/preprocess.test.ts.snap +108 -171
  7. package/e2e/__snapshots__/regression.test.ts.snap +167 -208
  8. package/e2e/merge-includes.spec.ts +70 -0
  9. package/mocks/merge-includes/html-comment-blanks/input/_includes/examples.md +27 -0
  10. package/mocks/merge-includes/html-comment-blanks/input/index.md +3 -0
  11. package/mocks/merge-includes/html-comment-blanks/input/main.md +15 -0
  12. package/mocks/merge-includes/html-comment-blanks/input/toc.yaml +5 -0
  13. package/mocks/merge-includes/include-after-fence/input/_includes/chat-button.md +1 -0
  14. package/mocks/merge-includes/include-after-fence/input/_includes/footer.md +1 -0
  15. package/mocks/merge-includes/include-after-fence/input/index.md +3 -0
  16. package/mocks/merge-includes/include-after-fence/input/main.md +14 -0
  17. package/mocks/merge-includes/include-after-fence/input/toc.yaml +5 -0
  18. package/mocks/merge-includes/include-in-code-block/input/_includes/glossary.md +1 -0
  19. package/mocks/merge-includes/include-in-code-block/input/index.md +3 -0
  20. package/mocks/merge-includes/include-in-code-block/input/main.md +19 -0
  21. package/mocks/merge-includes/include-in-code-block/input/toc.yaml +5 -0
  22. package/mocks/merge-includes/indent-paragraph-in-include/input/_includes/requirements.md +9 -0
  23. package/mocks/merge-includes/indent-paragraph-in-include/input/index.md +3 -0
  24. package/mocks/merge-includes/indent-paragraph-in-include/input/main.md +12 -0
  25. package/mocks/merge-includes/indent-paragraph-in-include/input/toc.yaml +5 -0
  26. package/mocks/merge-includes/yfm-table-html-block/input/_includes/button.md +8 -0
  27. package/mocks/merge-includes/yfm-table-html-block/input/index.md +3 -0
  28. package/mocks/merge-includes/yfm-table-html-block/input/main.md +12 -0
  29. package/mocks/merge-includes/yfm-table-html-block/input/toc.yaml +5 -0
  30. package/mocks/merge-includes/yfm-table-pipe-in-content/input/_includes/example.md +1 -0
  31. package/mocks/merge-includes/yfm-table-pipe-in-content/input/index.md +3 -0
  32. package/mocks/merge-includes/yfm-table-pipe-in-content/input/main.md +22 -0
  33. package/mocks/merge-includes/yfm-table-pipe-in-content/input/toc.yaml +5 -0
  34. package/package.json +1 -1
@@ -91,6 +91,43 @@ describe('Merge includes (md2md)', () => {
91
91
  await compareDirectories(outputPath);
92
92
  });
93
93
 
94
+ test('yfm-table: include ending with HTML block places || on its own line', async () => {
95
+ const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/yfm-table-html-block');
96
+
97
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
98
+ md2md: true,
99
+ md2html: false,
100
+ args: '--merge-includes',
101
+ });
102
+ await compareDirectories(outputPath);
103
+ });
104
+
105
+ test('yfm-table: include with `|` in inline code falls back to {% included %}', async () => {
106
+ const {inputPath, outputPath} = getTestPaths(
107
+ 'mocks/merge-includes/yfm-table-pipe-in-content',
108
+ );
109
+
110
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
111
+ md2md: true,
112
+ md2html: false,
113
+ args: '--merge-includes',
114
+ });
115
+ await compareDirectories(outputPath);
116
+ });
117
+
118
+ test('indent-paragraph: include under indent with indented top-level paragraph falls back to {% included %}', async () => {
119
+ const {inputPath, outputPath} = getTestPaths(
120
+ 'mocks/merge-includes/indent-paragraph-in-include',
121
+ );
122
+
123
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
124
+ md2md: true,
125
+ md2html: false,
126
+ args: '--merge-includes',
127
+ });
128
+ await compareDirectories(outputPath);
129
+ });
130
+
94
131
  test('html-in-list: include with <style> in list (any indent) uses fallback', async () => {
95
132
  const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/html-in-list');
96
133
 
@@ -123,4 +160,37 @@ describe('Merge includes (md2md)', () => {
123
160
  });
124
161
  await compareDirectories(outputPath);
125
162
  });
163
+
164
+ test('html-comment-blanks: blank lines inside HTML comments keep list/cut continuity', async () => {
165
+ const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/html-comment-blanks');
166
+
167
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
168
+ md2md: true,
169
+ md2html: false,
170
+ args: '--merge-includes',
171
+ });
172
+ await compareDirectories(outputPath);
173
+ });
174
+
175
+ test('include-in-code-block: include shown as code example is NOT expanded', async () => {
176
+ const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/include-in-code-block');
177
+
178
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
179
+ md2md: true,
180
+ md2html: false,
181
+ args: '--merge-includes',
182
+ });
183
+ await compareDirectories(outputPath);
184
+ });
185
+
186
+ test('include-after-fence: include placed right after a closing ``` fence is inlined', async () => {
187
+ const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/include-after-fence');
188
+
189
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
190
+ md2md: true,
191
+ md2html: false,
192
+ args: '--merge-includes',
193
+ });
194
+ await compareDirectories(outputPath);
195
+ });
126
196
  });
@@ -0,0 +1,27 @@
1
+ - [Real link one](https://example.com/one)
2
+
3
+ - [Real link two](https://example.com/two)
4
+
5
+ <!--
6
+ #|
7
+ ||
8
+ **Header A**
9
+ |
10
+ **Header B**
11
+ ||
12
+
13
+ ||
14
+ Body cell A1
15
+
16
+ with blank lines inside the comment
17
+
18
+ |
19
+ Body cell B1
20
+ ||
21
+
22
+ ||
23
+ Body cell A2
24
+ |
25
+ Body cell B2
26
+ ||
27
+ |# -->
@@ -0,0 +1,3 @@
1
+ # Index
2
+
3
+ Welcome page.
@@ -0,0 +1,15 @@
1
+ # Main
2
+
3
+ Intro paragraph.
4
+
5
+ - Item one with cut
6
+
7
+ {% cut "Examples" %}
8
+
9
+ {% include [examples](_includes/examples.md) %}
10
+
11
+ {% endcut %}
12
+
13
+ - Item two
14
+
15
+ After list paragraph that must still render.
@@ -0,0 +1,5 @@
1
+ title: Merge Includes HTML Comment Blanks
2
+ href: index.md
3
+ items:
4
+ - name: Main
5
+ href: main.md
@@ -0,0 +1 @@
1
+ [Написать в чат](https://example.com/chat){.button}
@@ -0,0 +1,3 @@
1
+ # Index
2
+
3
+ Welcome page.
@@ -0,0 +1,14 @@
1
+ # Main
2
+
3
+ Some intro text.
4
+
5
+ ```javascript
6
+ <script type="text/javascript">
7
+ function setCookie(name, value){
8
+ document.cookie = name + "=" + value + ";path=/";
9
+ }
10
+ </script>
11
+ ```
12
+ {% include [chat-button](_includes/chat-button.md) %}
13
+
14
+ {% include [footer](_includes/footer.md) %}
@@ -0,0 +1,5 @@
1
+ title: Include After Fence
2
+ href: index.md
3
+ items:
4
+ - name: Main
5
+ href: main.md
@@ -0,0 +1 @@
1
+ [*glossary]: Glossary section
@@ -0,0 +1,3 @@
1
+ # Index
2
+
3
+ Welcome page.
@@ -0,0 +1,19 @@
1
+ # Main
2
+
3
+ Real include below — should be inlined:
4
+
5
+ {% include [glossary](_includes/glossary.md) %}
6
+
7
+ Steps:
8
+
9
+ 1. Open the resource file.
10
+ 1. Insert the include directive into the file:
11
+
12
+ ```plaintext
13
+ {% include notitle [glossary](_includes/glossary.md) %}
14
+ [*glossary]: Magic line
15
+ ```
16
+
17
+ 1. Use the keys from glossary.
18
+
19
+ End of page.
@@ -0,0 +1,5 @@
1
+ title: Include In Code Block
2
+ href: index.md
3
+ items:
4
+ - name: Main
5
+ href: main.md
@@ -0,0 +1,9 @@
1
+ 1\. Format: HTML5.
2
+
3
+ 2\. The banner stretches to fit the screen.
4
+
5
+ 3\. The banner must stretch to 100% of the screen width.
6
+
7
+ Width is set as a percentage value: 100%.
8
+
9
+ 4\. Maximum archive size is 75 KB.
@@ -0,0 +1,3 @@
1
+ # Index
2
+
3
+ Welcome page.
@@ -0,0 +1,12 @@
1
+ # Main Document
2
+
3
+ {% list tabs %}
4
+
5
+ - Mobile banner
6
+
7
+
8
+ {% include [requirements](_includes/requirements.md) %}
9
+
10
+ For more details see the requirements page.
11
+
12
+ {% endlist %}
@@ -0,0 +1,5 @@
1
+ title: Merge Includes Indent Paragraph In Include
2
+ href: index.md
3
+ items:
4
+ - name: Main
5
+ href: main.md
@@ -0,0 +1,8 @@
1
+ [Subscribe](https://example.com/subscribe){.button}
2
+
3
+ <style>
4
+ a.button {
5
+ color: black;
6
+ background: yellow;
7
+ }
8
+ </style>
@@ -0,0 +1,3 @@
1
+ # Index
2
+
3
+ Welcome page.
@@ -0,0 +1,12 @@
1
+ # Main Document
2
+
3
+ #|
4
+ || **Option** | **Details** ||
5
+ || Option A |
6
+ Some description of option A.
7
+
8
+ {% include [button](_includes/button.md) %}||
9
+ || Option B | Plain text cell. ||
10
+ |#
11
+
12
+ Content after table.
@@ -0,0 +1,5 @@
1
+ title: Merge Includes YFM Table HTML Block
2
+ href: index.md
3
+ items:
4
+ - name: Main
5
+ href: main.md
@@ -0,0 +1 @@
1
+ If you want to track clicking a particular button with the ID that contains `button` or `buy`, you can specify the following condition: `button|buy`.
@@ -0,0 +1,3 @@
1
+ # Index
2
+
3
+ Welcome page.
@@ -0,0 +1,22 @@
1
+ # Main Document
2
+
3
+ #|
4
+ ||
5
+ **Criterion**
6
+ |
7
+ **Description**
8
+ ||
9
+ ||
10
+ **regular expression**
11
+ |
12
+ This is used for tracking goal identifiers that match a pattern.
13
+
14
+ {% cut "Example" %}
15
+
16
+ {% include [example](_includes/example.md) %}
17
+
18
+ {% endcut %}
19
+ ||
20
+ |#
21
+
22
+ Content after table.
@@ -0,0 +1,5 @@
1
+ title: Merge Includes YFM Table Pipe In Content
2
+ href: index.md
3
+ items:
4
+ - name: Main
5
+ href: main.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.39.7",
3
+ "version": "5.40.0",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },