-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated markdown renderer, added localhost:* to CSP connect-src (#1310)
- Loading branch information
Showing
11 changed files
with
4,089 additions
and
4,289 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...bible-react/src/preview/pages/components/advanced/markdown-renderer-example.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import MarkdownRenderer from '@/components/advanced/extension-marketplace/markdown-renderer.component'; | ||
import { Input } from '@/components/shadcn-ui/input'; | ||
import { useState } from 'react'; | ||
|
||
function MarkdownRendererExample() { | ||
const [markdown, setMarkdown] = useState(` | ||
# Sample Markdown | ||
<!-- Here's a comment --> | ||
This is an example of some markdown content that can be displayed using the \`MarkdownRenderer\` component in \`platform-bible-react\`. | ||
- This is *one thing* | ||
- This is **another** | ||
<div style="color: red"> | ||
This is a red div | ||
</div> | ||
## Here's an h2 | ||
1. Here's the first list item | ||
2. And the second item | ||
3. Visit [example.com](https://example.com) now! | ||
| Sample | Column | headers | | ||
|---------|--------|---------| | ||
| Row | thing | another | | ||
| Header | some | thing | | ||
| Another | 3 | *512* | | ||
\`\`\`typescript | ||
const doesSupportCodeBlocks = true; | ||
const doesSupportSyntaxHighlighting = false; | ||
\`\`\``); | ||
const [anchorTarget, setAnchorTarget] = useState(''); | ||
return ( | ||
<div> | ||
<div> | ||
Anchor Target:{' '} | ||
<Input | ||
className="tw-inline-block" | ||
value={anchorTarget} | ||
onChange={(event) => setAnchorTarget(event.target.value)} | ||
/>{' '} | ||
(Change this to _blank to make links open in a new tab) | ||
</div> | ||
<textarea | ||
className="tw-resize" | ||
cols={60} | ||
rows={15} | ||
value={markdown} | ||
onChange={(event) => setMarkdown(event.target.value)} | ||
/> | ||
<MarkdownRenderer markdown={markdown} anchorTarget={anchorTarget} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default MarkdownRendererExample; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters