@diplodoc/cli-tests 5.39.7 → 5.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/e2e/__snapshots__/include-toc.test.ts.snap +23 -50
- package/e2e/__snapshots__/includes-conditions.test.ts.snap +15 -29
- package/e2e/__snapshots__/includes.test.ts.snap +437 -147
- package/e2e/__snapshots__/merge-includes.spec.ts.snap +400 -1
- package/e2e/__snapshots__/pdf-page.spec.ts.snap +0 -1
- package/e2e/__snapshots__/preprocess.test.ts.snap +108 -171
- package/e2e/__snapshots__/regression.test.ts.snap +167 -208
- package/e2e/merge-includes.spec.ts +70 -0
- package/mocks/merge-includes/html-comment-blanks/input/_includes/examples.md +27 -0
- package/mocks/merge-includes/html-comment-blanks/input/index.md +3 -0
- package/mocks/merge-includes/html-comment-blanks/input/main.md +15 -0
- package/mocks/merge-includes/html-comment-blanks/input/toc.yaml +5 -0
- package/mocks/merge-includes/include-after-fence/input/_includes/chat-button.md +1 -0
- package/mocks/merge-includes/include-after-fence/input/_includes/footer.md +1 -0
- package/mocks/merge-includes/include-after-fence/input/index.md +3 -0
- package/mocks/merge-includes/include-after-fence/input/main.md +14 -0
- package/mocks/merge-includes/include-after-fence/input/toc.yaml +5 -0
- package/mocks/merge-includes/include-in-code-block/input/_includes/glossary.md +1 -0
- package/mocks/merge-includes/include-in-code-block/input/index.md +3 -0
- package/mocks/merge-includes/include-in-code-block/input/main.md +19 -0
- package/mocks/merge-includes/include-in-code-block/input/toc.yaml +5 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/_includes/requirements.md +9 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/index.md +3 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/main.md +12 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/toc.yaml +5 -0
- package/mocks/merge-includes/yfm-table-html-block/input/_includes/button.md +8 -0
- package/mocks/merge-includes/yfm-table-html-block/input/index.md +3 -0
- package/mocks/merge-includes/yfm-table-html-block/input/main.md +12 -0
- package/mocks/merge-includes/yfm-table-html-block/input/toc.yaml +5 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/_includes/example.md +1 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/index.md +3 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/main.md +22 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/toc.yaml +5 -0
- package/package.json +1 -1
|
@@ -91,6 +91,43 @@ describe('Merge includes (md2md)', () => {
|
|
|
91
91
|
await compareDirectories(outputPath);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
+
test('yfm-table: include ending with HTML block places || on its own line', async () => {
|
|
95
|
+
const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/yfm-table-html-block');
|
|
96
|
+
|
|
97
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
98
|
+
md2md: true,
|
|
99
|
+
md2html: false,
|
|
100
|
+
args: '--merge-includes',
|
|
101
|
+
});
|
|
102
|
+
await compareDirectories(outputPath);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('yfm-table: include with `|` in inline code falls back to {% included %}', async () => {
|
|
106
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
107
|
+
'mocks/merge-includes/yfm-table-pipe-in-content',
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
111
|
+
md2md: true,
|
|
112
|
+
md2html: false,
|
|
113
|
+
args: '--merge-includes',
|
|
114
|
+
});
|
|
115
|
+
await compareDirectories(outputPath);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('indent-paragraph: include under indent with indented top-level paragraph falls back to {% included %}', async () => {
|
|
119
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
120
|
+
'mocks/merge-includes/indent-paragraph-in-include',
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
124
|
+
md2md: true,
|
|
125
|
+
md2html: false,
|
|
126
|
+
args: '--merge-includes',
|
|
127
|
+
});
|
|
128
|
+
await compareDirectories(outputPath);
|
|
129
|
+
});
|
|
130
|
+
|
|
94
131
|
test('html-in-list: include with <style> in list (any indent) uses fallback', async () => {
|
|
95
132
|
const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/html-in-list');
|
|
96
133
|
|
|
@@ -123,4 +160,37 @@ describe('Merge includes (md2md)', () => {
|
|
|
123
160
|
});
|
|
124
161
|
await compareDirectories(outputPath);
|
|
125
162
|
});
|
|
163
|
+
|
|
164
|
+
test('html-comment-blanks: blank lines inside HTML comments keep list/cut continuity', async () => {
|
|
165
|
+
const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/html-comment-blanks');
|
|
166
|
+
|
|
167
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
168
|
+
md2md: true,
|
|
169
|
+
md2html: false,
|
|
170
|
+
args: '--merge-includes',
|
|
171
|
+
});
|
|
172
|
+
await compareDirectories(outputPath);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test('include-in-code-block: include shown as code example is NOT expanded', async () => {
|
|
176
|
+
const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/include-in-code-block');
|
|
177
|
+
|
|
178
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
179
|
+
md2md: true,
|
|
180
|
+
md2html: false,
|
|
181
|
+
args: '--merge-includes',
|
|
182
|
+
});
|
|
183
|
+
await compareDirectories(outputPath);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
test('include-after-fence: include placed right after a closing ``` fence is inlined', async () => {
|
|
187
|
+
const {inputPath, outputPath} = getTestPaths('mocks/merge-includes/include-after-fence');
|
|
188
|
+
|
|
189
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
190
|
+
md2md: true,
|
|
191
|
+
md2html: false,
|
|
192
|
+
args: '--merge-includes',
|
|
193
|
+
});
|
|
194
|
+
await compareDirectories(outputPath);
|
|
195
|
+
});
|
|
126
196
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
- [Real link one](https://example.com/one)
|
|
2
|
+
|
|
3
|
+
- [Real link two](https://example.com/two)
|
|
4
|
+
|
|
5
|
+
<!--
|
|
6
|
+
#|
|
|
7
|
+
||
|
|
8
|
+
**Header A**
|
|
9
|
+
|
|
|
10
|
+
**Header B**
|
|
11
|
+
||
|
|
12
|
+
|
|
13
|
+
||
|
|
14
|
+
Body cell A1
|
|
15
|
+
|
|
16
|
+
with blank lines inside the comment
|
|
17
|
+
|
|
18
|
+
|
|
|
19
|
+
Body cell B1
|
|
20
|
+
||
|
|
21
|
+
|
|
22
|
+
||
|
|
23
|
+
Body cell A2
|
|
24
|
+
|
|
|
25
|
+
Body cell B2
|
|
26
|
+
||
|
|
27
|
+
|# -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[Написать в чат](https://example.com/chat){.button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Footer text.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Main
|
|
2
|
+
|
|
3
|
+
Some intro text.
|
|
4
|
+
|
|
5
|
+
```javascript
|
|
6
|
+
<script type="text/javascript">
|
|
7
|
+
function setCookie(name, value){
|
|
8
|
+
document.cookie = name + "=" + value + ";path=/";
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
```
|
|
12
|
+
{% include [chat-button](_includes/chat-button.md) %}
|
|
13
|
+
|
|
14
|
+
{% include [footer](_includes/footer.md) %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[*glossary]: Glossary section
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Main
|
|
2
|
+
|
|
3
|
+
Real include below — should be inlined:
|
|
4
|
+
|
|
5
|
+
{% include [glossary](_includes/glossary.md) %}
|
|
6
|
+
|
|
7
|
+
Steps:
|
|
8
|
+
|
|
9
|
+
1. Open the resource file.
|
|
10
|
+
1. Insert the include directive into the file:
|
|
11
|
+
|
|
12
|
+
```plaintext
|
|
13
|
+
{% include notitle [glossary](_includes/glossary.md) %}
|
|
14
|
+
[*glossary]: Magic line
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
1. Use the keys from glossary.
|
|
18
|
+
|
|
19
|
+
End of page.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
If you want to track clicking a particular button with the ID that contains `button` or `buy`, you can specify the following condition: `button|buy`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Main Document
|
|
2
|
+
|
|
3
|
+
#|
|
|
4
|
+
||
|
|
5
|
+
**Criterion**
|
|
6
|
+
|
|
|
7
|
+
**Description**
|
|
8
|
+
||
|
|
9
|
+
||
|
|
10
|
+
**regular expression**
|
|
11
|
+
|
|
|
12
|
+
This is used for tracking goal identifiers that match a pattern.
|
|
13
|
+
|
|
14
|
+
{% cut "Example" %}
|
|
15
|
+
|
|
16
|
+
{% include [example](_includes/example.md) %}
|
|
17
|
+
|
|
18
|
+
{% endcut %}
|
|
19
|
+
||
|
|
20
|
+
|#
|
|
21
|
+
|
|
22
|
+
Content after table.
|