@diplodoc/cli-tests 5.13.3 → 5.14.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 (30) hide show
  1. package/e2e/__snapshots__/includes.test.ts.snap +477 -0
  2. package/e2e/__snapshots__/metadata.spec.ts.snap +19 -6
  3. package/e2e/__snapshots__/pdf-page.spec.ts.snap +2 -2
  4. package/e2e/__snapshots__/regression.test.ts.snap +64 -38
  5. package/e2e/includes.test.ts +38 -0
  6. package/fixtures/utils/file.ts +21 -0
  7. package/mocks/includes/input/.yfm +1 -0
  8. package/mocks/includes/input/_assets/4.png +0 -0
  9. package/mocks/includes/input/includes/commented-include.md +5 -0
  10. package/mocks/includes/input/includes/deep-include.md +13 -0
  11. package/mocks/includes/input/includes/fragments.md +23 -0
  12. package/mocks/includes/input/includes/nested-include.md +5 -0
  13. package/mocks/includes/input/includes/no-title-include.md +19 -0
  14. package/mocks/includes/input/includes/root-include.md +11 -0
  15. package/mocks/includes/input/includes/user.md +5 -0
  16. package/mocks/includes/input/index.md +62 -0
  17. package/mocks/includes/input/level1/includes/level1-include.md +11 -0
  18. package/mocks/includes/input/level1/level2/includes/level2-include.md +11 -0
  19. package/mocks/includes/input/level1/level2/page2.md +29 -0
  20. package/mocks/includes/input/level1/page1.md +29 -0
  21. package/mocks/includes/input/presets.yaml +3 -0
  22. package/mocks/includes/input/toc-include.md +13 -0
  23. package/mocks/includes/input/toc.yaml +13 -0
  24. package/mocks/includes-missing/input/index.md +7 -0
  25. package/mocks/includes-missing/input/toc.yaml +3 -0
  26. package/mocks/metadata/md2html-with-metadata/input/.yfm +1 -0
  27. package/mocks/metadata/md2html-with-metadata/input/page.md +3 -1
  28. package/mocks/regression/input/includes/fragments.md +17 -0
  29. package/mocks/regression/input/includes.md +4 -0
  30. package/package.json +1 -1
@@ -0,0 +1,477 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Includes > Various include scenarios > filelist 1`] = `
4
+ "[
5
+ ".yfm",
6
+ "_assets/4.png",
7
+ "includes/deep-include-hash.md",
8
+ "includes/fragments-hash.md",
9
+ "includes/nested-include-hash.md",
10
+ "includes/no-title-include-hash.md",
11
+ "includes/root-include-hash.md",
12
+ "includes/user-hash.md",
13
+ "index.md",
14
+ "level1/includes/level1-include-hash.md",
15
+ "level1/level2/includes/level2-include-hash.md",
16
+ "level1/level2/page2.md",
17
+ "level1/page1.md",
18
+ "toc-include-hash.md",
19
+ "toc-include.md",
20
+ "toc.yaml"
21
+ ]"
22
+ `;
23
+
24
+ exports[`Includes > Various include scenarios > filelist 2`] = `
25
+ "[
26
+ ".yfm",
27
+ "_assets/4.png",
28
+ "index.html",
29
+ "level1/level2/page2.html",
30
+ "level1/page1.html",
31
+ "toc-include.html",
32
+ "toc.js"
33
+ ]"
34
+ `;
35
+
36
+ exports[`Includes > Various include scenarios 1`] = `"projectTitle: Test Includes"`;
37
+
38
+ exports[`Includes > Various include scenarios 2`] = `
39
+ "# Deep nested include [→ index](../index.md) {#deep-nested-include}
40
+
41
+ [Link to index](../index.md)
42
+
43
+ [Link to level1 page1](../level1/page1.md)
44
+
45
+ [Link to level2 page2](../level1/level2/page2.md)
46
+
47
+ This is a deep nested include.
48
+
49
+ {% include [user](user-hash.md) %}
50
+
51
+ ![img 3](../_assets/4.png)"
52
+ `;
53
+
54
+ exports[`Includes > Various include scenarios 3`] = `
55
+ "# Fragments for include
56
+
57
+ ## Section 1 {#section1}
58
+
59
+ This is content of section 1.
60
+
61
+ ## Section 2 {#section2}
62
+
63
+ This is content of section 2.
64
+
65
+ ### Subsection 2.1 {#subsection21}
66
+
67
+ This is content of subsection 2.1.
68
+
69
+ ## Section 3 {#section3}
70
+
71
+ This is content of section 3.
72
+
73
+ Some paragraph with anchor {#p1}
74
+
75
+ Some paragraph without anchor
76
+
77
+ Some paragraph with anchor {#p2}"
78
+ `;
79
+
80
+ exports[`Includes > Various include scenarios 4`] = `
81
+ "# Nested include [→ index](../index.md) {#nested-include}
82
+
83
+ This is a nested include.
84
+
85
+ {% include [level1-include](../level1/includes/level1-include-hash.md) %}"
86
+ `;
87
+
88
+ exports[`Includes > Various include scenarios 5`] = `
89
+ "# Include without title [→ index](../index.md) {#include-without-title}
90
+
91
+ [Link to index](../index.md)
92
+
93
+ This is a test for include without title.
94
+
95
+ ## Include without title from the same directory
96
+
97
+ {% include notitle [user](user-hash.md) %}
98
+
99
+ ## Include without title with anchor
100
+
101
+ {% include notitle [fragment](fragments-hash.md#section1) %}
102
+
103
+ ## Include without title with paragraph anchor
104
+
105
+ {% include notitle [fragment](fragments-hash.md#p1) %}
106
+
107
+ [Link to index](../index.md)"
108
+ `;
109
+
110
+ exports[`Includes > Various include scenarios 6`] = `
111
+ "This is an include from the root level.
112
+
113
+ [Link to level1](../level1/page1.md)
114
+
115
+ [Link to level2](../level1/level2/page2.md)
116
+
117
+ [Link to index](../index.md)
118
+
119
+ ## Include with anchor [→ level1](../level1/page1.md) {#include-with-anchor}
120
+
121
+ {% include [fragment](fragments-hash.md#section2) %}"
122
+ `;
123
+
124
+ exports[`Includes > Various include scenarios 7`] = `
125
+ "# User include [→ index](../index.md) {#user-include}
126
+
127
+ [Link to index](../index.md)
128
+
129
+ This is a user include with variable substitution: Alice"
130
+ `;
131
+
132
+ exports[`Includes > Various include scenarios 8`] = `
133
+ "---
134
+ metadata:
135
+ - name: generator
136
+ content: Diplodoc Platform vDIPLODOC-VERSION
137
+ vcsPath: index.md
138
+ ---
139
+ # Test Includes
140
+
141
+ This is a test page for various include scenarios.
142
+
143
+ ## Include from root level
144
+
145
+ {% include [root-include](includes/root-include-hash.md) %}
146
+
147
+ ## Include from level1
148
+
149
+ {% include [level1-include](level1/includes/level1-include-hash.md) %}
150
+
151
+ ## Include from level2
152
+
153
+ {% include [level2-include](level1/level2/includes/level2-include-hash.md) %}
154
+
155
+ ## Include with missing file
156
+
157
+ <!-- {% include [missing](includes/missing.md) %} -->
158
+
159
+ ## Include file that is in toc
160
+
161
+ [Link to toc-include](toc-include.md)
162
+
163
+ {% include [toc-include](toc-include-hash.md) %}
164
+
165
+ ## Links to different levels
166
+
167
+ [Link to level1](level1/page1.md)
168
+
169
+ [Link to level2](level1/level2/page2.md)
170
+
171
+ ## Include with anchor
172
+
173
+ {% include [fragment](includes/fragments-hash.md#section1) %}
174
+
175
+ ## Include with multiple anchors
176
+
177
+ {% include [fragment](includes/fragments-hash.md#section2) %}
178
+
179
+ ## Include with paragraph anchor
180
+
181
+ {% include [fragment](includes/fragments-hash.md#p1) %}
182
+
183
+ ## Nested includes
184
+
185
+ {% include [nested](includes/nested-include-hash.md) %}
186
+
187
+ ## Deep nested includes
188
+
189
+ {% include [deep](includes/deep-include-hash.md) %}
190
+
191
+ ## Commented includes
192
+
193
+ <!-- {% include [commented](includes/commented-include.md) %} -->
194
+
195
+ ## Include with variable substitution
196
+
197
+ {% include [user](includes/user-hash.md) %}
198
+ ## Include without title
199
+
200
+ {% include [no-title-include](includes/no-title-include-hash.md) %}"
201
+ `;
202
+
203
+ exports[`Includes > Various include scenarios 9`] = `
204
+ "This is an include from level 1.
205
+
206
+ [Link to page1](../page1.md)
207
+
208
+ [Link to index](../../index.md)
209
+
210
+ [Link to level2](../level2/page2.md)
211
+
212
+ ## Include with anchor [→ root](../../index.md) {#include-with-anchor}
213
+
214
+ {% include [fragment](../../includes/fragments-hash.md#subsection21) %}"
215
+ `;
216
+
217
+ exports[`Includes > Various include scenarios 10`] = `
218
+ "This is an include from level 2.
219
+
220
+ [Link to page2](../page2.md)
221
+
222
+ [Link to page1](../../page1.md)
223
+
224
+ [Link to index](../../../index.md)
225
+
226
+ ## Include with anchor [→ level1](../../page1.md) {#include-with-anchor}
227
+
228
+ {% include [fragment](../../../includes/fragments-hash.md#section3) %}"
229
+ `;
230
+
231
+ exports[`Includes > Various include scenarios 11`] = `
232
+ "---
233
+ metadata:
234
+ - name: generator
235
+ content: Diplodoc Platform vDIPLODOC-VERSION
236
+ vcsPath: level1/level2/page2.md
237
+ ---
238
+ # Page 2
239
+
240
+ This is page 2 at level 2.
241
+
242
+ ## Include from level2
243
+
244
+ {% include [level2-include](includes/level2-include-hash.md) %}
245
+
246
+ ## Include from level1
247
+
248
+ {% include [level1-include](../includes/level1-include-hash.md) %}
249
+
250
+ ## Include from root
251
+
252
+ {% include [root-include](../../includes/root-include-hash.md) %}
253
+
254
+ ## Links to different levels
255
+
256
+ [Link to index](../../index.md)
257
+
258
+ [Link to page1](../page1.md)
259
+
260
+ ## Nested include
261
+
262
+ {% include [nested-include](../../includes/nested-include-hash.md) %}
263
+
264
+ ## Include with anchor
265
+
266
+ {% include [fragment](../../includes/fragments-hash.md#section3) %}"
267
+ `;
268
+
269
+ exports[`Includes > Various include scenarios 12`] = `
270
+ "---
271
+ metadata:
272
+ - name: generator
273
+ content: Diplodoc Platform vDIPLODOC-VERSION
274
+ vcsPath: level1/page1.md
275
+ ---
276
+ # Page 1
277
+
278
+ This is page 1 at level 1.
279
+
280
+ ## Include from level1
281
+
282
+ {% include [level1-include](includes/level1-include-hash.md) %}
283
+
284
+ ## Include from root
285
+
286
+ {% include [root-include](../includes/root-include-hash.md) %}
287
+
288
+ ## Include from level2
289
+
290
+ {% include [level2-include](level2/includes/level2-include-hash.md) %}
291
+
292
+ ## Links to different levels
293
+
294
+ [Link to index](../index.md)
295
+
296
+ [Link to level2](level2/page2.md)
297
+
298
+ ## Nested include
299
+
300
+ {% include [nested-include](../includes/nested-include-hash.md) %}
301
+
302
+ ## Include with anchor
303
+
304
+ {% include [fragment](../includes/fragments-hash.md#subsection21) %}"
305
+ `;
306
+
307
+ exports[`Includes > Various include scenarios 13`] = `
308
+ "# Toc Include
309
+
310
+ This file is included in the toc.
311
+
312
+ [Link to index](index.md)
313
+
314
+ [Link to page1](level1/page1.md)
315
+
316
+ [Link to page2](level1/level2/page2.md)
317
+
318
+ ## Include with anchor
319
+
320
+ {% include [fragment](includes/fragments-hash.md#section1) %}"
321
+ `;
322
+
323
+ exports[`Includes > Various include scenarios 14`] = `
324
+ "---
325
+ metadata:
326
+ - name: generator
327
+ content: Diplodoc Platform vDIPLODOC-VERSION
328
+ vcsPath: toc-include.md
329
+ ---
330
+ # Toc Include
331
+
332
+ This file is included in the toc.
333
+
334
+ [Link to index](index.md)
335
+
336
+ [Link to page1](level1/page1.md)
337
+
338
+ [Link to page2](level1/level2/page2.md)
339
+
340
+ ## Include with anchor
341
+
342
+ {% include [fragment](includes/fragments-hash.md#section1) %}"
343
+ `;
344
+
345
+ exports[`Includes > Various include scenarios 15`] = `
346
+ "items:
347
+ - name: Test Includes
348
+ href: index.md
349
+ - name: Toc Include
350
+ href: toc-include.md
351
+ - name: Level 1
352
+ items:
353
+ - name: Page 1
354
+ href: level1/page1.md
355
+ - name: Level 2
356
+ items:
357
+ - name: Page 2
358
+ href: level1/level2/page2.md
359
+ path: toc.yaml
360
+ "
361
+ `;
362
+
363
+ exports[`Includes > Various include scenarios 16`] = `"projectTitle: Test Includes"`;
364
+
365
+ exports[`Includes > Various include scenarios 17`] = `
366
+ "<!DOCTYPE html>
367
+ <html lang="ru" dir="ltr">
368
+ <head>
369
+ <meta charset="utf-8">
370
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
371
+ <base href="./" />
372
+ <title>Test Includes</title>
373
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
374
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
375
+ </head>
376
+ <body class="g-root g-root_theme_light">
377
+ <div id="root"></div>
378
+ <script type="application/json" id="diplodoc-state">
379
+ {"data":{"leading":false,"html":"&lt;p&gt;This is a test page for various include scenarios.&lt;/p&gt;/n&lt;h2 id=\\"include-from-root-level\\"&gt;&lt;a href=\\"index.html#include-from-root-level\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from root level&lt;/span&gt;&lt;/a&gt;Include from root level&lt;/h2&gt;/n&lt;p&gt;This is an include from the root level.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to level1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor\\"&gt;&lt;a href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → level1&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"level1/page1.html\\"&gt;→ level1&lt;/a&gt;&lt;/h2&gt;/n&lt;h2 id=\\"section2\\"&gt;&lt;a href=\\"index.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 2&lt;/span&gt;&lt;/a&gt;Section 2&lt;/h2&gt;/n&lt;p&gt;This is content of section 2.&lt;/p&gt;/n&lt;h3 id=\\"subsection21\\"&gt;&lt;a href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-from-level1\\"&gt;&lt;a href=\\"index.html#include-from-level1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from level1&lt;/span&gt;&lt;/a&gt;Include from level1&lt;/h2&gt;/n&lt;p&gt;This is an include from level 1.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor1\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → root&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"index.html\\"&gt;→ root&lt;/a&gt;&lt;/h2&gt;/n&lt;h3 id=\\"subsection211\\"&gt;&lt;a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-from-level2\\"&gt;&lt;a href=\\"index.html#include-from-level2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from level2&lt;/span&gt;&lt;/a&gt;Include from level2&lt;/h2&gt;/n&lt;p&gt;This is an include from level 2.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to page2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor2\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → level1&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"level1/page1.html\\"&gt;→ level1&lt;/a&gt;&lt;/h2&gt;/n&lt;h2 id=\\"section3\\"&gt;&lt;a href=\\"index.html#section3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 3&lt;/span&gt;&lt;/a&gt;Section 3&lt;/h2&gt;/n&lt;p&gt;This is content of section 3.&lt;/p&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;p&gt;Some paragraph without anchor&lt;/p&gt;/n&lt;p id=\\"p2\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;h2 id=\\"include-with-missing-file\\"&gt;&lt;a href=\\"index.html#include-with-missing-file\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with missing file&lt;/span&gt;&lt;/a&gt;Include with missing file&lt;/h2&gt;/n/n&lt;h2 id=\\"include-file-that-is-in-toc\\"&gt;&lt;a href=\\"index.html#include-file-that-is-in-toc\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include file that is in toc&lt;/span&gt;&lt;/a&gt;Include file that is in toc&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"toc-include.html\\"&gt;Link to toc-include&lt;/a&gt;&lt;/p&gt;/n&lt;h1&gt;Toc Include&lt;/h1&gt;/n&lt;p&gt;This file is included in the toc.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to page2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor3\\"&gt;&lt;a href=\\"index.html#include-with-anchor3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor&lt;/span&gt;&lt;/a&gt;Include with anchor&lt;/h2&gt;/n&lt;h2 id=\\"section1\\"&gt;&lt;a href=\\"index.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 1&lt;/span&gt;&lt;/a&gt;Section 1&lt;/h2&gt;/n&lt;p&gt;This is content of section 1.&lt;/p&gt;/n&lt;h2 id=\\"links-to-different-levels\\"&gt;&lt;a href=\\"index.html#links-to-different-levels\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Links to different levels&lt;/span&gt;&lt;/a&gt;Links to different levels&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to level1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor4\\"&gt;&lt;a href=\\"index.html#include-with-anchor4\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor&lt;/span&gt;&lt;/a&gt;Include with anchor&lt;/h2&gt;/n&lt;h2 id=\\"section11\\"&gt;&lt;a id=\\"section1\\" href=\\"index.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 1&lt;/span&gt;&lt;/a&gt;Section 1&lt;/h2&gt;/n&lt;p&gt;This is content of section 1.&lt;/p&gt;/n&lt;h2 id=\\"include-with-multiple-anchors\\"&gt;&lt;a href=\\"index.html#include-with-multiple-anchors\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with multiple anchors&lt;/span&gt;&lt;/a&gt;Include with multiple anchors&lt;/h2&gt;/n&lt;h2 id=\\"section21\\"&gt;&lt;a id=\\"section2\\" href=\\"index.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 2&lt;/span&gt;&lt;/a&gt;Section 2&lt;/h2&gt;/n&lt;p&gt;This is content of section 2.&lt;/p&gt;/n&lt;h3 id=\\"subsection212\\"&gt;&lt;a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-with-paragraph-anchor\\"&gt;&lt;a href=\\"index.html#include-with-paragraph-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with paragraph anchor&lt;/span&gt;&lt;/a&gt;Include with paragraph anchor&lt;/h2&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;h2 id=\\"nested-includes\\"&gt;&lt;a href=\\"index.html#nested-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Nested includes&lt;/span&gt;&lt;/a&gt;Nested includes&lt;/h2&gt;/n&lt;h1 id=\\"nested-include\\"&gt;Nested include &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;This is a nested include.&lt;/p&gt;/n&lt;p&gt;This is an include from level 1.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor5\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → root&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"index.html\\"&gt;→ root&lt;/a&gt;&lt;/h2&gt;/n&lt;h3 id=\\"subsection213\\"&gt;&lt;a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"deep-nested-includes\\"&gt;&lt;a href=\\"index.html#deep-nested-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Deep nested includes&lt;/span&gt;&lt;/a&gt;Deep nested includes&lt;/h2&gt;/n&lt;h1 id=\\"deep-nested-include\\"&gt;Deep nested include &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to level1 page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2 page2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;This is a deep nested include.&lt;/p&gt;/n&lt;h1 id=\\"user-include\\"&gt;User include &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;This is a user include with variable substitution: Alice&lt;/p&gt;/n&lt;p&gt;&lt;img src=\\"_assets/4.png\\" alt=\\"img 3\\" /&gt;&lt;/p&gt;/n&lt;h2 id=\\"commented-includes\\"&gt;&lt;a href=\\"index.html#commented-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Commented includes&lt;/span&gt;&lt;/a&gt;Commented includes&lt;/h2&gt;/n/n&lt;h2 id=\\"include-with-variable-substitution\\"&gt;&lt;a href=\\"index.html#include-with-variable-substitution\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with variable substitution&lt;/span&gt;&lt;/a&gt;Include with variable substitution&lt;/h2&gt;/n&lt;h1 id=\\"user-include\\"&gt;User include &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;This is a user include with variable substitution: Alice&lt;/p&gt;/n&lt;h2 id=\\"include-without-title\\"&gt;&lt;a href=\\"index.html#include-without-title\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include without title&lt;/span&gt;&lt;/a&gt;Include without title&lt;/h2&gt;/n&lt;h1 id=\\"include-without-title\\"&gt;Include without title &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;This is a test for include without title.&lt;/p&gt;/n&lt;h2 id=\\"include-without-title-from-the-same-directory\\"&gt;&lt;a href=\\"index.html#include-without-title-from-the-same-directory\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include without title from the same directory&lt;/span&gt;&lt;/a&gt;Include without title from the same directory&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;This is a user include with variable substitution: Alice&lt;/p&gt;/n&lt;h2 id=\\"include-without-title-with-anchor\\"&gt;&lt;a href=\\"index.html#include-without-title-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include without title with anchor&lt;/span&gt;&lt;/a&gt;Include without title with anchor&lt;/h2&gt;/n&lt;p&gt;This is content of section 1.&lt;/p&gt;/n&lt;h2 id=\\"include-without-title-with-paragraph-anchor\\"&gt;&lt;a href=\\"index.html#include-without-title-with-paragraph-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include without title with paragraph anchor&lt;/span&gt;&lt;/a&gt;Include without title with paragraph anchor&lt;/h2&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.md"},"headings":[{"title":"Include from root level","href":"index.html#include-from-root-level","level":2},{"title":"Include with anchor → level1","href":"index.html#include-with-anchor","level":2},{"title":"Section 2","href":"index.html#section2","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection21","level":3}]},{"title":"Include from level1","href":"index.html#include-from-level1","level":2},{"title":"Include with anchor → root","href":"index.html#include-with-anchor1","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection211","level":3}]},{"title":"Include from level2","href":"index.html#include-from-level2","level":2},{"title":"Include with anchor → level1","href":"index.html#include-with-anchor2","level":2},{"title":"Section 3","href":"index.html#section3","level":2},{"title":"Include with missing file","href":"index.html#include-with-missing-file","level":2},{"title":"Include file that is in toc","href":"index.html#include-file-that-is-in-toc","level":2},{"title":"Include with anchor","href":"index.html#include-with-anchor3","level":2},{"title":"Section 1","href":"index.html#section1","level":2},{"title":"Links to different levels","href":"index.html#links-to-different-levels","level":2},{"title":"Include with anchor","href":"index.html#include-with-anchor4","level":2},{"title":"Section 1","href":"index.html#section11","level":2},{"title":"Include with multiple anchors","href":"index.html#include-with-multiple-anchors","level":2},{"title":"Section 2","href":"index.html#section21","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection212","level":3}]},{"title":"Include with paragraph anchor","href":"index.html#include-with-paragraph-anchor","level":2},{"title":"Nested includes","href":"index.html#nested-includes","level":2},{"title":"Include with anchor → root","href":"index.html#include-with-anchor5","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection213","level":3}]},{"title":"Deep nested includes","href":"index.html#deep-nested-includes","level":2},{"title":"Commented includes","href":"index.html#commented-includes","level":2},{"title":"Include with variable substitution","href":"index.html#include-with-variable-substitution","level":2},{"title":"Include without title","href":"index.html#include-without-title","level":2},{"title":"Include without title from the same directory","href":"index.html#include-without-title-from-the-same-directory","level":2},{"title":"Include without title with anchor","href":"index.html#include-without-title-with-anchor","level":2},{"title":"Include without title with paragraph anchor","href":"index.html#include-without-title-with-paragraph-anchor","level":2}],"title":"Test Includes"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
380
+ </script>
381
+ <script type="application/javascript">
382
+ const data = document.querySelector('script#diplodoc-state');
383
+ window.__DATA__ = JSON.parse((function unescape(string) {
384
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
385
+ })(data.innerText));
386
+ window.STATIC_CONTENT = false;
387
+ </script>
388
+ <script type="application/javascript" defer src="toc.js"></script>
389
+ </body>
390
+ </html>"
391
+ `;
392
+
393
+ exports[`Includes > Various include scenarios 18`] = `
394
+ "<!DOCTYPE html>
395
+ <html lang="ru" dir="ltr">
396
+ <head>
397
+ <meta charset="utf-8">
398
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
399
+ <base href="../../" />
400
+ <title>Page 2</title>
401
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
402
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
403
+ </head>
404
+ <body class="g-root g-root_theme_light">
405
+ <div id="root"></div>
406
+ <script type="application/json" id="diplodoc-state">
407
+ {"data":{"leading":false,"html":"&lt;p&gt;This is page 2 at level 2.&lt;/p&gt;/n&lt;h2 id=\\"include-from-level2\\"&gt;&lt;a href=\\"level1/level2/page2.html#include-from-level2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from level2&lt;/span&gt;&lt;/a&gt;Include from level2&lt;/h2&gt;/n&lt;p&gt;This is an include from level 2.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to page2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor\\"&gt;&lt;a href=\\"level1/level2/page2.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → level1&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"level1/page1.html\\"&gt;→ level1&lt;/a&gt;&lt;/h2&gt;/n&lt;h2 id=\\"section3\\"&gt;&lt;a href=\\"level1/level2/page2.html#section3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 3&lt;/span&gt;&lt;/a&gt;Section 3&lt;/h2&gt;/n&lt;p&gt;This is content of section 3.&lt;/p&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;p&gt;Some paragraph without anchor&lt;/p&gt;/n&lt;p id=\\"p2\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;h2 id=\\"include-from-level1\\"&gt;&lt;a href=\\"level1/level2/page2.html#include-from-level1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from level1&lt;/span&gt;&lt;/a&gt;Include from level1&lt;/h2&gt;/n&lt;p&gt;This is an include from level 1.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor1\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"level1/level2/page2.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → root&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"index.html\\"&gt;→ root&lt;/a&gt;&lt;/h2&gt;/n&lt;h3 id=\\"subsection21\\"&gt;&lt;a href=\\"level1/level2/page2.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-from-root\\"&gt;&lt;a href=\\"level1/level2/page2.html#include-from-root\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from root&lt;/span&gt;&lt;/a&gt;Include from root&lt;/h2&gt;/n&lt;p&gt;This is an include from the root level.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to level1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor2\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"level1/level2/page2.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → level1&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"level1/page1.html\\"&gt;→ level1&lt;/a&gt;&lt;/h2&gt;/n&lt;h2 id=\\"section2\\"&gt;&lt;a href=\\"level1/level2/page2.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 2&lt;/span&gt;&lt;/a&gt;Section 2&lt;/h2&gt;/n&lt;p&gt;This is content of section 2.&lt;/p&gt;/n&lt;h3 id=\\"subsection211\\"&gt;&lt;a id=\\"subsection21\\" href=\\"level1/level2/page2.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"links-to-different-levels\\"&gt;&lt;a href=\\"level1/level2/page2.html#links-to-different-levels\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Links to different levels&lt;/span&gt;&lt;/a&gt;Links to different levels&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"nested-include\\"&gt;&lt;a href=\\"level1/level2/page2.html#nested-include\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Nested include&lt;/span&gt;&lt;/a&gt;Nested include&lt;/h2&gt;/n&lt;h1 id=\\"nested-include\\"&gt;Nested include &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;This is a nested include.&lt;/p&gt;/n&lt;p&gt;This is an include from level 1.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor3\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"level1/level2/page2.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → root&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"index.html\\"&gt;→ root&lt;/a&gt;&lt;/h2&gt;/n&lt;h3 id=\\"subsection212\\"&gt;&lt;a id=\\"subsection21\\" href=\\"level1/level2/page2.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor4\\"&gt;&lt;a href=\\"level1/level2/page2.html#include-with-anchor4\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor&lt;/span&gt;&lt;/a&gt;Include with anchor&lt;/h2&gt;/n&lt;h2 id=\\"section31\\"&gt;&lt;a id=\\"section3\\" href=\\"level1/level2/page2.html#section3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 3&lt;/span&gt;&lt;/a&gt;Section 3&lt;/h2&gt;/n&lt;p&gt;This is content of section 3.&lt;/p&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;p&gt;Some paragraph without anchor&lt;/p&gt;/n&lt;p id=\\"p2\\"&gt;Some paragraph with anchor&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"level1/level2/page2.md"},"headings":[{"title":"Include from level2","href":"level1/level2/page2.html#include-from-level2","level":2},{"title":"Include with anchor → level1","href":"level1/level2/page2.html#include-with-anchor","level":2},{"title":"Section 3","href":"level1/level2/page2.html#section3","level":2},{"title":"Include from level1","href":"level1/level2/page2.html#include-from-level1","level":2},{"title":"Include with anchor → root","href":"level1/level2/page2.html#include-with-anchor1","level":2,"items":[{"title":"Subsection 2.1","href":"level1/level2/page2.html#subsection21","level":3}]},{"title":"Include from root","href":"level1/level2/page2.html#include-from-root","level":2},{"title":"Include with anchor → level1","href":"level1/level2/page2.html#include-with-anchor2","level":2},{"title":"Section 2","href":"level1/level2/page2.html#section2","level":2,"items":[{"title":"Subsection 2.1","href":"level1/level2/page2.html#subsection211","level":3}]},{"title":"Links to different levels","href":"level1/level2/page2.html#links-to-different-levels","level":2},{"title":"Nested include","href":"level1/level2/page2.html#nested-include","level":2},{"title":"Include with anchor → root","href":"level1/level2/page2.html#include-with-anchor3","level":2,"items":[{"title":"Subsection 2.1","href":"level1/level2/page2.html#subsection212","level":3}]},{"title":"Include with anchor","href":"level1/level2/page2.html#include-with-anchor4","level":2},{"title":"Section 3","href":"level1/level2/page2.html#section31","level":2}],"title":"Page 2"},"router":{"pathname":"level1/level2/page2","depth":3,"base":"../../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
408
+ </script>
409
+ <script type="application/javascript">
410
+ const data = document.querySelector('script#diplodoc-state');
411
+ window.__DATA__ = JSON.parse((function unescape(string) {
412
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
413
+ })(data.innerText));
414
+ window.STATIC_CONTENT = false;
415
+ </script>
416
+ <script type="application/javascript" defer src="toc.js"></script>
417
+ </body>
418
+ </html>"
419
+ `;
420
+
421
+ exports[`Includes > Various include scenarios 19`] = `
422
+ "<!DOCTYPE html>
423
+ <html lang="ru" dir="ltr">
424
+ <head>
425
+ <meta charset="utf-8">
426
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
427
+ <base href="../" />
428
+ <title>Page 1</title>
429
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
430
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
431
+ </head>
432
+ <body class="g-root g-root_theme_light">
433
+ <div id="root"></div>
434
+ <script type="application/json" id="diplodoc-state">
435
+ {"data":{"leading":false,"html":"&lt;p&gt;This is page 1 at level 1.&lt;/p&gt;/n&lt;h2 id=\\"include-from-level1\\"&gt;&lt;a href=\\"level1/page1.html#include-from-level1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from level1&lt;/span&gt;&lt;/a&gt;Include from level1&lt;/h2&gt;/n&lt;p&gt;This is an include from level 1.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor\\"&gt;&lt;a href=\\"level1/page1.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → root&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"index.html\\"&gt;→ root&lt;/a&gt;&lt;/h2&gt;/n&lt;h3 id=\\"subsection21\\"&gt;&lt;a href=\\"level1/page1.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-from-root\\"&gt;&lt;a href=\\"level1/page1.html#include-from-root\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from root&lt;/span&gt;&lt;/a&gt;Include from root&lt;/h2&gt;/n&lt;p&gt;This is an include from the root level.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to level1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor1\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"level1/page1.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → level1&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"level1/page1.html\\"&gt;→ level1&lt;/a&gt;&lt;/h2&gt;/n&lt;h2 id=\\"section2\\"&gt;&lt;a href=\\"level1/page1.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 2&lt;/span&gt;&lt;/a&gt;Section 2&lt;/h2&gt;/n&lt;p&gt;This is content of section 2.&lt;/p&gt;/n&lt;h3 id=\\"subsection211\\"&gt;&lt;a id=\\"subsection21\\" href=\\"level1/page1.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-from-level2\\"&gt;&lt;a href=\\"level1/page1.html#include-from-level2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include from level2&lt;/span&gt;&lt;/a&gt;Include from level2&lt;/h2&gt;/n&lt;p&gt;This is an include from level 2.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to page2&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor2\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"level1/page1.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → level1&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"level1/page1.html\\"&gt;→ level1&lt;/a&gt;&lt;/h2&gt;/n&lt;h2 id=\\"section3\\"&gt;&lt;a href=\\"level1/page1.html#section3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 3&lt;/span&gt;&lt;/a&gt;Section 3&lt;/h2&gt;/n&lt;p&gt;This is content of section 3.&lt;/p&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;p&gt;Some paragraph without anchor&lt;/p&gt;/n&lt;p id=\\"p2\\"&gt;Some paragraph with anchor&lt;/p&gt;/n&lt;h2 id=\\"links-to-different-levels\\"&gt;&lt;a href=\\"level1/page1.html#links-to-different-levels\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Links to different levels&lt;/span&gt;&lt;/a&gt;Links to different levels&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"nested-include\\"&gt;&lt;a href=\\"level1/page1.html#nested-include\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Nested include&lt;/span&gt;&lt;/a&gt;Nested include&lt;/h2&gt;/n&lt;h1 id=\\"nested-include\\"&gt;Nested include &lt;a href=\\"index.html\\"&gt;→ index&lt;/a&gt;&lt;/h1&gt;/n&lt;p&gt;This is a nested include.&lt;/p&gt;/n&lt;p&gt;This is an include from level 1.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to level2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor3\\"&gt;&lt;a id=\\"include-with-anchor\\" href=\\"level1/page1.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor → root&lt;/span&gt;&lt;/a&gt;Include with anchor &lt;a href=\\"index.html\\"&gt;→ root&lt;/a&gt;&lt;/h2&gt;/n&lt;h3 id=\\"subsection212\\"&gt;&lt;a id=\\"subsection21\\" href=\\"level1/page1.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor4\\"&gt;&lt;a href=\\"level1/page1.html#include-with-anchor4\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor&lt;/span&gt;&lt;/a&gt;Include with anchor&lt;/h2&gt;/n&lt;h3 id=\\"subsection213\\"&gt;&lt;a id=\\"subsection21\\" href=\\"level1/page1.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Subsection 2.1&lt;/span&gt;&lt;/a&gt;Subsection 2.1&lt;/h3&gt;/n&lt;p&gt;This is content of subsection 2.1.&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"level1/page1.md"},"headings":[{"title":"Include from level1","href":"level1/page1.html#include-from-level1","level":2},{"title":"Include with anchor → root","href":"level1/page1.html#include-with-anchor","level":2,"items":[{"title":"Subsection 2.1","href":"level1/page1.html#subsection21","level":3}]},{"title":"Include from root","href":"level1/page1.html#include-from-root","level":2},{"title":"Include with anchor → level1","href":"level1/page1.html#include-with-anchor1","level":2},{"title":"Section 2","href":"level1/page1.html#section2","level":2,"items":[{"title":"Subsection 2.1","href":"level1/page1.html#subsection211","level":3}]},{"title":"Include from level2","href":"level1/page1.html#include-from-level2","level":2},{"title":"Include with anchor → level1","href":"level1/page1.html#include-with-anchor2","level":2},{"title":"Section 3","href":"level1/page1.html#section3","level":2},{"title":"Links to different levels","href":"level1/page1.html#links-to-different-levels","level":2},{"title":"Nested include","href":"level1/page1.html#nested-include","level":2},{"title":"Include with anchor → root","href":"level1/page1.html#include-with-anchor3","level":2,"items":[{"title":"Subsection 2.1","href":"level1/page1.html#subsection212","level":3}]},{"title":"Include with anchor","href":"level1/page1.html#include-with-anchor4","level":2,"items":[{"title":"Subsection 2.1","href":"level1/page1.html#subsection213","level":3}]}],"title":"Page 1"},"router":{"pathname":"level1/page1","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
436
+ </script>
437
+ <script type="application/javascript">
438
+ const data = document.querySelector('script#diplodoc-state');
439
+ window.__DATA__ = JSON.parse((function unescape(string) {
440
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
441
+ })(data.innerText));
442
+ window.STATIC_CONTENT = false;
443
+ </script>
444
+ <script type="application/javascript" defer src="toc.js"></script>
445
+ </body>
446
+ </html>"
447
+ `;
448
+
449
+ exports[`Includes > Various include scenarios 20`] = `
450
+ "<!DOCTYPE html>
451
+ <html lang="ru" dir="ltr">
452
+ <head>
453
+ <meta charset="utf-8">
454
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
455
+ <base href="./" />
456
+ <title>Toc Include</title>
457
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
458
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
459
+ </head>
460
+ <body class="g-root g-root_theme_light">
461
+ <div id="root"></div>
462
+ <script type="application/json" id="diplodoc-state">
463
+ {"data":{"leading":false,"html":"&lt;p&gt;This file is included in the toc.&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"index.html\\"&gt;Link to index&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/page1.html\\"&gt;Link to page1&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"level1/level2/page2.html\\"&gt;Link to page2&lt;/a&gt;&lt;/p&gt;/n&lt;h2 id=\\"include-with-anchor\\"&gt;&lt;a href=\\"toc-include.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include with anchor&lt;/span&gt;&lt;/a&gt;Include with anchor&lt;/h2&gt;/n&lt;h2 id=\\"section1\\"&gt;&lt;a href=\\"toc-include.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Section 1&lt;/span&gt;&lt;/a&gt;Section 1&lt;/h2&gt;/n&lt;p&gt;This is content of section 1.&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"toc-include.md"},"headings":[{"title":"Include with anchor","href":"toc-include.html#include-with-anchor","level":2},{"title":"Section 1","href":"toc-include.html#section1","level":2}],"title":"Toc Include"},"router":{"pathname":"toc-include","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
464
+ </script>
465
+ <script type="application/javascript">
466
+ const data = document.querySelector('script#diplodoc-state');
467
+ window.__DATA__ = JSON.parse((function unescape(string) {
468
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
469
+ })(data.innerText));
470
+ window.STATIC_CONTENT = false;
471
+ </script>
472
+ <script type="application/javascript" defer src="toc.js"></script>
473
+ </body>
474
+ </html>"
475
+ `;
476
+
477
+ exports[`Includes > Various include scenarios 21`] = `"window.__DATA__.data.toc = {"items":[{"name":"Test Includes","href":"index.html","id":"UUID"},{"name":"Toc Include","href":"toc-include.html","id":"UUID"},{"name":"Level 1","items":[{"name":"Page 1","href":"level1/page1.html","id":"UUID"},{"name":"Level 2","items":[{"name":"Page 2","href":"level1/level2/page2.html","id":"UUID"}],"id":"UUID"}],"id":"UUID"}],"path":"toc.yaml","id":"UUID"};"`;