chore: add changeset for scaffolder markdown list behavior fix
Signed-off-by: Vivek Hipparkar <vivekhipparkar@gmail.com>
This commit is contained in:
@@ -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 = [
|
||||
|
||||
+1
-4
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user