chore: add changeset for scaffolder markdown list behavior fix

Signed-off-by: Vivek Hipparkar <vivekhipparkar@gmail.com>
This commit is contained in:
Vivek Hipparkar
2026-02-21 11:44:00 +05:30
parent 4e762e6893
commit 58b9f3f88c
3 changed files with 16 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Use Backstage Link component for markdown anchor rendering to ensure consistent internal and external link behavior.
@@ -23,6 +23,7 @@ import { HeadingProps } from 'react-markdown/lib/ast-to-react';
import rehypeRaw from 'rehype-raw';
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
import type { PluggableList } from 'react-markdown/lib/react-markdown';
import { Link } from '../Link';
export type MarkdownContentClassKey = 'markdown';
@@ -109,6 +110,15 @@ const components: Options['components'] = {
h4: headingRenderer,
h5: headingRenderer,
h6: headingRenderer,
a: ({ href, children, ...props }) =>
href ? (
<Link {...(props as any)} to={href}>
{children}
</Link>
) : (
<>{children}</>
),
};
const gfmRehypePlugins: PluggableList = [
@@ -96,10 +96,7 @@ export const DefaultTemplateOutputs = (props: {
titleTypographyProps={{ component: 'h2' }}
>
<Box padding={2} height="100%">
<MarkdownContent
content={textOutput.content ?? ''}
linkTarget="_blank"
/>
<MarkdownContent content={textOutput.content ?? ''} />
</Box>
</InfoCard>
</Box>