Skip to content

Commit 462e9f3

Browse files
committed
test html removal
1 parent c7a2af2 commit 462e9f3

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

docusaurus.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const clsx = require('clsx');
44
const { createApiPageMD, createInfoPageMD } = require('docusaurus-plugin-openapi-docs/lib/markdown');
55
const { remark } = require('remark');
66
const mdxRemoveImports = require('remark-mdx-remove-imports');
7+
const stripHtml = require('remark-strip-html');
78

89
const { config } = require('./apify-docs-theme');
910
const { collectSlugs } = require('./tools/utils/collectSlugs');
@@ -365,11 +366,14 @@ module.exports = {
365366
result.frontMatter.image ??= ogImageURL.toString();
366367

367368
const strip = (await import('strip-markdown')).default; // ESM only
368-
const mdx = (await import('remark-mdx')).default; // ESM only
369+
// const mdx = (await import('remark-mdx')).default; // ESM only
369370

370371
// Use remark to strip markdown and get plain text
371372
const processed = await remark()
372-
.use(mdx).use(mdxRemoveImports).use(strip)
373+
.use(stripHtml)
374+
// .use(mdx)
375+
.use(mdxRemoveImports)
376+
.use(strip)
373377
.process(result.content);
374378
const contentText = String(processed).replace(/\s+/g, ' ').trim();
375379
// Extract the first sentence (ending with . ! or ?) even if it spans multiple lines

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"remark": "^15.0.1",
6666
"remark-mdx": "^3.1.1",
6767
"remark-mdx-remove-imports": "^1.6.22",
68+
"remark-strip-html": "^1.0.2",
6869
"rimraf": "^6.0.0",
6970
"strip-markdown": "^6.0.0",
7071
"typescript": "5.9.2",

0 commit comments

Comments
 (0)