Skip to content

Commit

Permalink
Update readme with example usage of 'html' value, and point to the Gi…
Browse files Browse the repository at this point in the history
…thub repository in package.json file
  • Loading branch information
adamjarling committed Jun 14, 2024
1 parent e6cd330 commit 6d9f135
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ const MyComponent = () => {
export default MyComponent;
```

Alternatively, you can do something with the `html` string directly.

```jsx
const { html } = useMarkdown(markdown);

// Do something with the html string
const newHtml = html + "<p>foo</p>";

return <div dangerouslySetInnerHTML={{ __html: newHtml }} />;
```

## Development

Run in development environment.
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"repository": {
"type": "git",
"url": "https://github.com/nulib/use-markdown"
}
}

0 comments on commit 6d9f135

Please sign in to comment.