Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card renders escaped html #2653

Open
1 task
gtitov opened this issue Dec 3, 2024 · 0 comments
Open
1 task

Card renders escaped html #2653

gtitov opened this issue Dec 3, 2024 · 0 comments

Comments

@gtitov
Copy link

gtitov commented Dec 3, 2024

What version of starlight are you using?

^0.29.2

What version of astro are you using?

^4.16.10

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

I wanted to show HTML-tag as text in a title of a Card. Here are my attempts.

Does it work as expected? Can you recommend a better solution?

import { Card, CardGrid } from '@astrojs/starlight/components';

{/* didn't work */}
<Card title="<div>test</div>">
  Edit `src/content/docs/index.mdx` to see this page change.
</Card>
{/* unexpectedly didn't work */}
<Card title="&lt;div&gt;test&lt;/div&gt;">
  Add Markdown or MDX files to `src/content/docs` to create new pages.
</Card>
{/* did it */}
<Card title={'&lt;div&gt;test&lt;/div&gt;'}>
  Edit your `sidebar` and other config in `astro.config.mjs`.
</Card>

image

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-wosagm?file=src%2Fcontent%2Fdocs%2Findex.mdx&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant