From: Mark Otto Date: Wed, 11 Mar 2026 20:51:15 +0000 (-0700) Subject: Fix docs links in inline HTML (#42151) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c87669fd7733470f1cdbbc3a8ca8a466e999e72f;p=thirdparty%2Fbootstrap.git Fix docs links in inline HTML (#42151) * Fix docs links in inline HTML * ya --- diff --git a/site/src/content/docs/getting-started/install.mdx b/site/src/content/docs/getting-started/install.mdx index a22db70050..19b0eae953 100644 --- a/site/src/content/docs/getting-started/install.mdx +++ b/site/src/content/docs/getting-started/install.mdx @@ -130,8 +130,8 @@ You can also do the old fashioned thing and download Bootstrap manually. Choose | Type | Description | Link | | --- | --- | --- | -| Distribution files | Ready-to-use compiled and minified CSS and JavaScript files. Doesn't include documentation, source files, or dependencies like Floating UI. | {/*Download*/} | -| Source files | Sass, JavaScript, and documentation files for compiling with your own asset pipeline. Requires [Sass compiler]([[docsref:/guides/contribute#sass]]), [Autoprefixer](https://github.com/postcss/autoprefixer), and a JavaScript bundler like [Rollup](https://rollupjs.org/) or [Webpack](https://webpack.js.org/). | {/*Download*/} | +| Distribution files | Ready-to-use compiled and minified CSS and JavaScript files. Doesn't include documentation, source files, or dependencies like Floating UI. | Download | +| Source files | Sass, JavaScript, and documentation files for compiling with your own asset pipeline. Requires [Sass compiler]([[docsref:/guides/contribute#sass]]), [Autoprefixer](https://github.com/postcss/autoprefixer), and a JavaScript bundler like [Rollup](https://rollupjs.org/) or [Webpack](https://webpack.js.org/). | Download | Should you require our full set of [build tools]([[docsref:/guides/contribute#tooling-setup]]), they are included for developing Bootstrap and its docs, but they’re likely unsuitable for your own purposes. diff --git a/site/src/libs/remark.ts b/site/src/libs/remark.ts index 9d532be42d..369f306796 100644 --- a/site/src/libs/remark.ts +++ b/site/src/libs/remark.ts @@ -26,33 +26,38 @@ export const remarkBsConfig: Plugin<[], Root> = function () { // https://github.com/syntax-tree/mdast#nodes // https://github.com/syntax-tree/mdast-util-mdx-jsx#nodes - visit(ast, ['code', 'definition', 'image', 'inlineCode', 'link', 'mdxJsxFlowElement', 'text'], (node) => { - switch (node.type) { - case 'code': - case 'inlineCode': - case 'text': { - node.value = replaceConfigInText(node.value) - break - } - case 'image': { - if (node.alt) { - node.alt = replaceConfigInText(node.alt) + visit( + ast, + ['code', 'definition', 'image', 'inlineCode', 'link', 'mdxJsxFlowElement', 'mdxJsxTextElement', 'text'], + (node) => { + switch (node.type) { + case 'code': + case 'inlineCode': + case 'text': { + node.value = replaceConfigInText(node.value) + break } + case 'image': { + if (node.alt) { + node.alt = replaceConfigInText(node.alt) + } - node.url = replaceConfigInText(node.url) - break - } - case 'definition': - case 'link': { - node.url = replaceConfigInText(node.url) - break - } - case 'mdxJsxFlowElement': { - node.attributes = replaceConfigInAttributes(node.attributes) - break + node.url = replaceConfigInText(node.url) + break + } + case 'definition': + case 'link': { + node.url = replaceConfigInText(node.url) + break + } + case 'mdxJsxFlowElement': + case 'mdxJsxTextElement': { + node.attributes = replaceConfigInAttributes(node.attributes) + break + } } } - }) + ) } } @@ -70,13 +75,14 @@ export const remarkBsDocsref: Plugin<[], Root> = function () { // https://github.com/syntax-tree/mdast#nodes // https://github.com/syntax-tree/mdast-util-mdx-jsx#nodes - visit(ast, ['definition', 'link', 'mdxJsxTextElement'], (node) => { + visit(ast, ['definition', 'link', 'mdxJsxFlowElement', 'mdxJsxTextElement'], (node) => { switch (node.type) { case 'definition': case 'link': { node.url = replaceDocsrefInText(node.url) break } + case 'mdxJsxFlowElement': case 'mdxJsxTextElement': { node.attributes = replaceDocsrefInAttributes(node.attributes) break