@diplodoc/cli-tests 5.22.3 → 5.22.5

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.
@@ -197,7 +197,15 @@ This is a test page for various include scenarios.
197
197
  {% include [user](includes/user-hash.md) %}
198
198
  ## Include without title
199
199
 
200
- {% include [no-title-include](includes/no-title-include-hash.md) %}"
200
+ {% include [no-title-include](includes/no-title-include-hash.md) %}
201
+
202
+ ## Include with anchor {#anchor}
203
+
204
+ {% include notitle [anchor](#anchor) %}
205
+ {% include [anchor](#anchor) %}
206
+
207
+ {% include [no-title-include](includes/no-title-include-hash.md#anchor) %}
208
+ "
201
209
  `;
202
210
 
203
211
  exports[`Includes > Various include scenarios 9`] = `
@@ -381,7 +389,7 @@ exports[`Includes > Various include scenarios 17`] = `
381
389
  <body class="g-root g-root_theme_light">
382
390
  <div id="root"></div>
383
391
  <script type="application/json" id="diplodoc-state">
384
- {"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}}
392
+ {"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&lt;h2 id=\\"anchor\\"&gt;&lt;a href=\\"index.html#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;p&gt;{% include notitle &lt;a href=\\"index.html#anchor\\"&gt;anchor&lt;/a&gt; %}&lt;br /&gt;/n{% include &lt;a href=\\"index.html#anchor\\"&gt;anchor&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":"Include with anchor","href":"index.html#anchor","level":2}],"title":"Test Includes"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
385
393
  </script>
386
394
  <script type="application/javascript">
387
395
  const data = document.querySelector('script#diplodoc-state');
@@ -702,10 +702,6 @@ exports[`Translate command > do not filter files on extract > filelist 1`] = `
702
702
  "es/index.md.xliff",
703
703
  "es/nested/a1.md.skl",
704
704
  "es/nested/a1.md.xliff",
705
- "es/nested/folder1/a1.md.skl",
706
- "es/nested/folder1/a1.md.xliff",
707
- "es/nested/folder1/toc-i.yaml.skl",
708
- "es/nested/folder1/toc-i.yaml.xliff",
709
705
  "es/nested/index-yfm.md.skl",
710
706
  "es/nested/index-yfm.md.xliff",
711
707
  "es/nested/index.yaml.skl",
@@ -804,6 +800,23 @@ exports[`Translate command > do not resolve liquid conditions if vars not specif
804
800
  </xliff>"
805
801
  `;
806
802
 
803
+ exports[`Translate command > do not translate merged entries with included toc > filelist 1`] = `
804
+ "[
805
+ "included-toc.md.skl",
806
+ "included-toc.md.xliff",
807
+ "index.md.skl",
808
+ "index.md.xliff",
809
+ "merged-included-toc-item.md.skl",
810
+ "merged-included-toc-item.md.xliff",
811
+ "no-translate.md.skl",
812
+ "no-translate.md.xliff",
813
+ "openapi-spec.yaml.skl",
814
+ "openapi-spec.yaml.xliff",
815
+ "toc.yaml.skl",
816
+ "toc.yaml.xliff"
817
+ ]"
818
+ `;
819
+
807
820
  exports[`Translate command > extract openapi spec files > filelist 1`] = `
808
821
  "[
809
822
  "openapi-spec.yaml.skl",
@@ -0,0 +1,26 @@
1
+ import {readFileSync} from 'node:fs';
2
+ import {resolve} from 'node:path';
3
+ import {describe, expect, test} from 'vitest';
4
+
5
+ import {TestAdapter, getTestPaths} from '../fixtures';
6
+
7
+ describe('Nested include links', () => {
8
+ test('Links in nested includes should resolve relative to the include file, not the entry file', async () => {
9
+ const {inputPath, outputPath} = getTestPaths('mocks/nested-include-links');
10
+
11
+ // Build directly to HTML
12
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
13
+ md2md: false,
14
+ md2html: true,
15
+ });
16
+
17
+ const htmlPath = resolve(outputPath, 'sub/deep/entry.html');
18
+ const html = readFileSync(htmlPath, 'utf8');
19
+
20
+ // The link from other/page.md is [link to target](../target.md)
21
+ // It should resolve relative to other/page.md → target.md → target.html
22
+ // NOT relative to the entry file sub/deep/entry.md → sub/deep/target.html
23
+ expect(html).toContain('target.html');
24
+ expect(html).not.toContain('sub/deep/target.html');
25
+ });
26
+ });
@@ -100,6 +100,16 @@ describe('Translate command', () => {
100
100
  target: 'es-ES',
101
101
  });
102
102
 
103
+ generateMapTestTemplate(
104
+ 'do not translate merged entries with included toc',
105
+ 'mocks/translation/toc-include',
106
+ {
107
+ subcommand: 'extract',
108
+ source: 'ru-RU',
109
+ target: 'es-ES',
110
+ },
111
+ );
112
+
103
113
  generateMapTestTemplate('do not filter files on extract', 'mocks/translation/dir-files', {
104
114
  subcommand: 'extract',
105
115
  source: 'ru-RU',
@@ -59,4 +59,11 @@ This is a test page for various include scenarios.
59
59
  {% include [user](includes/user.md) %}
60
60
  ## Include without title
61
61
 
62
- {% include [no-title-include](includes/no-title-include.md) %}
62
+ {% include [no-title-include](includes/no-title-include.md) %}
63
+
64
+ ## Include with anchor {#anchor}
65
+
66
+ {% include notitle [anchor](#anchor) %}
67
+ {% include [anchor](#anchor) %}
68
+
69
+ {% include [no-title-include](includes/no-title-include.md#anchor) %}
@@ -0,0 +1,4 @@
1
+ #### Section title {#section}
2
+
3
+ {% include notitle [page](../other/page.md) %}
4
+
@@ -0,0 +1,4 @@
1
+ # Nested page
2
+
3
+ [link to target](../target.md)
4
+
@@ -0,0 +1,8 @@
1
+ - вы подключаете устройство, для которого не [popup](*popup);
2
+ - другие способы настройки не сработали.
3
+
4
+
5
+
6
+ [*popup]:
7
+ {% include notitle [section](../../includes/middle.md#section) %}
8
+
@@ -0,0 +1,4 @@
1
+ # Target page
2
+
3
+ This is the target page that the link should point to.
4
+
@@ -0,0 +1,6 @@
1
+ items:
2
+ - name: Target
3
+ href: target.md
4
+ - name: Entry
5
+ href: sub/deep/entry.md
6
+
@@ -0,0 +1,3 @@
1
+ items:
2
+ - name: Included TOC Item
3
+ href: merged-included-toc-item.md
@@ -0,0 +1 @@
1
+ ### Included toc
@@ -0,0 +1,7 @@
1
+ ## Index header
2
+
3
+ ::no-translate [adsfasdfasdfasdfasdf]
4
+
5
+ lorem
6
+
7
+ asdfasdfasdf
@@ -0,0 +1 @@
1
+ #### Included toc item
@@ -0,0 +1,57 @@
1
+ # No-translate directive
2
+
3
+ ## Block directive
4
+ :::no-translate
5
+ ### No-translate header
6
+
7
+ :::html-block
8
+ testsetsets
9
+ :::
10
+
11
+ ::: any-other-directive
12
+ content test
13
+ :::
14
+
15
+ Should not be translated.
16
+ Can use **markup** inside.
17
+ :::
18
+
19
+
20
+ ::: some-other-directive
21
+ content here
22
+ :::
23
+ ::: no-translate
24
+ content here
25
+ ::: some-other-directive
26
+ nested content
27
+ :::
28
+ :::
29
+
30
+ ## Leaf directive
31
+
32
+ ::no-translate [## /usr/local/bin/application]
33
+ ::no-translate[**C:\Program Files\Application\config.ini**]
34
+ ::no-translate [~/Documents/project/src/main.rs]
35
+
36
+
37
+ - :no-translate[GET /api/v1/users] — get all users
38
+ - :no-translate[POST /api/v1/auth/login] — authorization
39
+ - :no-translate[PUT /api/v1/users/{id}] — update users data
40
+
41
+ ## Simple case leaf
42
+ Install using command.
43
+ :no-translate[The default port is unless specified.] Next sentence.
44
+ Set NODE_ENV=production for production builds.
45
+
46
+ ## Simple case inline
47
+ Install using :no-translate[npm install @company/package] command.
48
+ The default port is :no-translate[8080] unless specified.
49
+ Set :no-translate[NODE_ENV=production] for production builds.
50
+
51
+ ## Few inline directives
52
+ Use :no-translate[**GET /api/v1/users**] to list users and :no-translate[POST /api/v1/users] to create.
53
+
54
+ ## Empty inline directive
55
+ This is text with empty :no-translate[] directive.
56
+
57
+
@@ -0,0 +1,37 @@
1
+ openapi: 3.0.1
2
+ info:
3
+ title: OpenAPI definition
4
+ version: v0
5
+ servers:
6
+ - url: http://localhost:8080
7
+ description: Generated server url
8
+ paths:
9
+ /test:
10
+ get:
11
+ tags:
12
+ - test-controller
13
+ summary: Simple get operation. тест новой верстки 3
14
+ description: Defines a simple get :no-translate[skip this] operation with no inputs and a complex
15
+ operationId: getWithPayloadResponse
16
+ responses:
17
+ "200":
18
+ description: 200!!!!
19
+ content:
20
+ application/json:
21
+ schema:
22
+ $ref: '#/components/schemas/RecurceTop'
23
+ components:
24
+ schemas:
25
+ RecurceTop:
26
+ type: object
27
+ properties:
28
+ A:
29
+ type: string
30
+ # $ref: '#/components/schemas/RecurceMiddle'
31
+ RecurceMiddle:
32
+ type: object
33
+ properties:
34
+ B:
35
+ type: array
36
+ items:
37
+ $ref: '#/components/schemas/RecurceTop'
@@ -0,0 +1,14 @@
1
+ title: Test123
2
+ href: index.md
3
+ items:
4
+ - name: Не переводить
5
+ href: no-translate.md
6
+ - name: openapi
7
+ include:
8
+ path: openapi
9
+ includers:
10
+ - name: openapi
11
+ input: openapi-spec.yaml
12
+ - name: Included TOC
13
+ href: included-toc.md
14
+ include: { mode: merge, path: included-toc/toc.yaml }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.22.3",
3
+ "version": "5.22.5",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },
package/tsconfig.json CHANGED
@@ -12,5 +12,5 @@
12
12
  "rootDir": "."
13
13
  },
14
14
  "include": ["fixtures/**/*", "**/*.test.ts", "**/*.spec.ts", "vitest.config.ts"],
15
- "exclude": ["dist"]
15
+ "exclude": ["mocks/**/*"]
16
16
  }