Skip to content

Commit

Permalink
Merge pull request #9557 from marmelab/expand-markdown-field-doc
Browse files Browse the repository at this point in the history
Doc: Improve MarkdownField doc
  • Loading branch information
djhi committed Jan 4, 2024
2 parents 1fb781e + 2dbd2f8 commit 767e459
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/MarkdownField.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ title: "The MarkdownField Component"

This [Enterprise Edition](https://marmelab.com/ra-enterprise)<img class="icon" src="./img/premium.svg" /> component allows to render Markdown data as HTML.

![MarkdownField preview](https://marmelab.com/ra-enterprise/modules/assets/ra-markdown/latest/markdown-field-preview.png)

```jsx
import { Show, SimpleShowLayout, TextField } from 'react-admin';
import { MarkdownField } from '@react-admin/ra-markdown';
Expand All @@ -21,4 +23,19 @@ const PostShow = () => (
);
```

**Tip**: If you want to display raw (unformatted) markdown, use `<TextField component="pre">` instead:

```tsx
import { Show, SimpleShowLayout, TextField } from 'react-admin';

const PostShow = () => (
<Show>
<SimpleShowLayout>
<TextField source="title" />
<TextField source="description" component="pre" />
</SimpleShowLayout>
</Show>
);
```

Check [the `ra-markdown` documentation](https://marmelab.com/ra-enterprise/modules/ra-markdown) for more details.

0 comments on commit 767e459

Please sign in to comment.