Skip to content

Commit d7d7de9

Browse files
committed
revert escaping of HTML comments
1 parent 5209554 commit d7d7de9

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docusaurus.config.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const { join } = require('node:path');
22

33
const clsx = require('clsx');
4+
const { createApiPageMD } = require('docusaurus-plugin-openapi-docs/lib/markdown');
45

56
const { config } = require('./apify-docs-theme');
67
const { collectSlugs } = require('./tools/utils/collectSlugs');
@@ -195,15 +196,28 @@ module.exports = {
195196
v2: {
196197
specPath: 'apify-api.yaml',
197198
outputDir: './sources/api',
199+
markdownGenerators: {
200+
createApiPageMD: (pageData) => {
201+
let md = createApiPageMD(pageData);
202+
203+
// HTML comments are wrongly escaped, we need to undo that
204+
if (md.includes('<!--')) {
205+
md = md.replace('&lt;!--', '<!--');
206+
md = md.replace('--&gt;', '-->');
207+
}
208+
209+
return md;
210+
},
211+
},
198212
sidebarOptions: {
199-
groupPathsBy: 'tag',
213+
groupPathsBy: 'tagGroup',
200214
categoryLinkSource: 'tag',
201215
sidebarCollapsed: false,
202216
sidebarCollapsible: false,
203217
sidebarGenerators: {
204218
createDocItem: (item, context) => {
205219
const legacyUrls = item.api?.['x-legacy-doc-urls'] ?? [];
206-
const altIds = legacyUrls.map((url) => {
220+
const altids = legacyUrls.map((url) => {
207221
const { hash } = new URL(url);
208222
return hash;
209223
});
@@ -223,7 +237,7 @@ module.exports = {
223237
type: 'doc',
224238
id: context.basePath === '' ? `${id}` : `${context.basePath}/${id}`,
225239
label: sidebarLabel ?? title ?? id,
226-
customProps: { altIds },
240+
customProps: { altids },
227241
className,
228242
};
229243
},

0 commit comments

Comments
 (0)