Skip to content

Commit c0382a6

Browse files
authored
[Docs Site] Add ignore-md class for vendored Markdown (#23711)
1 parent 9bef60f commit c0382a6

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/components/overrides/PageTitle.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const hideBreadcrumbs = Astro.locals.starlightRoute.hideBreadcrumbs;
122122

123123
{
124124
component && (
125-
<div class="sl-markdown-content">
125+
<div class="sl-markdown-content md-ignore">
126126
<ComponentUsage component={component} />
127127
</div>
128128
)

src/content/docs/style-guide/components/render.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { Render } from "~/components";
3838
When using the `Render` component inside partials, the original `product` is lost.
3939

4040
For example, if there are three files:
41-
4241
1. `docs/fundamentals/index.mdx`
4342
2. `partials/dns/thing.mdx`
4443
3. `partials/dns/thing2.mdx`
@@ -195,4 +194,6 @@ import { Render } from "~/components";
195194

196195
## Partials
197196

198-
<PartialsUsage />
197+
<div class="md-ignore">
198+
<PartialsUsage />
199+
</div>

src/plugins/rehype/filter-elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const ALLOWED_ATTRIBUTES: Record<string, string[]> = {
113113

114114
const UNWRAP_CLASS_NAMES = ["heading-wrapper"];
115115

116-
const DISALLOWED_CLASS_NAMES = ["external-link", "anchor-link"];
116+
const DISALLOWED_CLASS_NAMES = ["external-link", "anchor-link", "md-ignore"];
117117

118118
export default function () {
119119
return function (tree: Root) {

src/util/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function htmlToMarkdown(
1515
url: string,
1616
): Promise<string | undefined> {
1717
const dom = parse(html);
18-
const content = dom.querySelector(".sl-markdown-content");
18+
const content = dom.querySelector(".sl-markdown-content:not(.md-ignore)");
1919

2020
if (!content) {
2121
return;

0 commit comments

Comments
 (0)