@diplodoc/cli-tests 5.23.1 → 5.24.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.
@@ -1176,7 +1176,7 @@ exports[`Regression > internal 45`] = `
1176
1176
  <body class="g-root g-root_theme_light">
1177
1177
  <div id="root"></div>
1178
1178
  <script type="application/json" id="diplodoc-state">
1179
- {"data":{"leading":false,"html":"&lt;p&gt;Text&lt;/p&gt;/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;Test&lt;/p&gt;/n&lt;h3 id=\\"f1\\"&gt;&lt;a href=\\"includes.html#f1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;F1&lt;/span&gt;&lt;/a&gt;F1&lt;/h3&gt;/n&lt;p&gt;Content F1&lt;/p&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"latex.html\\"&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"img 3\\" /&gt;&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;sup&gt;&lt;i class=\\"yfm yfm-term_title\\" term-key=\\":term\\" role=\\"button\\" aria-describedby=\\":term_element\\" tabindex=\\"0\\" id=\\"xc42lewq\\"&gt;?&lt;/i&gt;&lt;/sup&gt;&lt;/p&gt;/n&lt;p&gt;[&lt;i class=\\"yfm yfm-term_title\\" term-key=\\":term\\" role=\\"button\\" aria-describedby=\\":term_element\\" tabindex=\\"0\\" id=\\"vl3znzw0\\"&gt;?&lt;/i&gt;](http://ya.ru)&lt;/p&gt;/n&lt;p&gt;Link after include&lt;br /&gt;/n&lt;a href=\\"1.html#subtitle\\"&gt;Subtitle&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Link after include&lt;/p&gt;/n&lt;dfn class=\\"yfm yfm-term_dfn\\" id=\\":term_element\\" role=\\"dialog\\"&gt;&lt;p&gt;Test terms&lt;/p&gt;/n&lt;/dfn&gt;","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"includes.md"},"headings":[],"title":""},"router":{"pathname":"includes","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1179
+ {"data":{"leading":false,"html":"&lt;p&gt;Text&lt;/p&gt;/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;Test&lt;/p&gt;/n&lt;h3 id=\\"f1\\"&gt;&lt;a href=\\"includes.html#f1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;F1&lt;/span&gt;&lt;/a&gt;F1&lt;/h3&gt;/n&lt;p&gt;Content F1&lt;/p&gt;/n&lt;p id=\\"p1\\"&gt;Some paragraph with anchor&lt;/p&gt;/n/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"latex.html\\"&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"img 3\\" /&gt;&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;&lt;sup&gt;&lt;i class=\\"yfm yfm-term_title\\" term-key=\\":term\\" role=\\"button\\" aria-describedby=\\":term_element\\" tabindex=\\"0\\" id=\\"vTERM-ID\\"&gt;?&lt;/i&gt;&lt;/sup&gt;&lt;/p&gt;/n&lt;p&gt;[&lt;i class=\\"yfm yfm-term_title\\" term-key=\\":term\\" role=\\"button\\" aria-describedby=\\":term_element\\" tabindex=\\"0\\" id=\\"vTERM-ID\\"&gt;?&lt;/i&gt;](http://ya.ru)&lt;/p&gt;/n&lt;p&gt;Link after include&lt;br /&gt;/n&lt;a href=\\"1.html#subtitle\\"&gt;Subtitle&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Link after include&lt;/p&gt;/n&lt;dfn class=\\"yfm yfm-term_dfn\\" id=\\":term_element\\" role=\\"dialog\\"&gt;&lt;p&gt;Test terms&lt;/p&gt;/n&lt;/dfn&gt;","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"includes.md"},"headings":[],"title":""},"router":{"pathname":"includes","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1180
1180
  </script>
1181
1181
  <script type="application/javascript">
1182
1182
  const data = document.querySelector('script#diplodoc-state');
@@ -61,6 +61,15 @@ describe('Errors', () => {
61
61
  ['--max-asset-size', '2K'],
62
62
  );
63
63
 
64
+ test('mocks/errors/invalid-frontmatter', ({md, html}: TestResult) => {
65
+ expectErrors(md, [
66
+ 'ERR index.md: 2: YFM017 / invalid front matter format [Reason: "duplicated mapping key"; Line: 2; Key: "title"]',
67
+ ]);
68
+ expectErrors(html, [
69
+ 'ERR index.md: 2: YFM017 / invalid front matter format [Reason: "duplicated mapping key"; Line: 2; Key: "title"]',
70
+ ]);
71
+ });
72
+
64
73
  it('translate extract with filtered links', async () => {
65
74
  const {inputPath, outputPath} = getTestPaths('mocks/errors/extract-filtered-link');
66
75
 
@@ -16,6 +16,10 @@ export function platformless(text: string): string {
16
16
  /(content"?[:=]{1}[" ]{1}Diplodoc.*? )v\d+\.\d+\.\d+(?:-[\w-]+)?/g,
17
17
  `$1vDIPLODOC-VERSION`,
18
18
  )
19
+ .replace(
20
+ /(aria-describedby=\\":term_element\\" tabindex=\\"\d\\" id=\\")[a-zA-Z0-9]{1,10}/g,
21
+ `$1vTERM-ID`,
22
+ )
19
23
  .replace(/(\\(?![/"'])){1,2}/g, '/')
20
24
  .replace(
21
25
  /id=\\"inline-code-id-[a-zA-Z0-9]{8}\\"/g,
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Test Document
3
+ title: Duplicate Key
4
+ description: This front matter has a duplicated mapping key
5
+ ---
6
+
7
+ # Test Document
8
+
9
+ This is a test document with invalid front matter.
@@ -0,0 +1 @@
1
+ href: index.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.23.1",
3
+ "version": "5.24.0",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },