mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
publish: sanitise markdown snippets in preview
Runs the snippet through ReactMarkdown instead of rendering it as text. We restrict the allowed nodes in the render to pure text, so the snippet is not overly visually heavy.
This commit is contained in:
parent
2bfcf20bf7
commit
ff70a2be89
@ -71,7 +71,10 @@ export class NotebookPosts extends Component {
|
||||
</div>
|
||||
<p className="mb1"
|
||||
style={{overflowWrap: "break-word"}}>
|
||||
{note.snippet}
|
||||
<ReactMarkdown
|
||||
unwrapDisallowed
|
||||
allowedTypes={['text', 'root', 'break', 'paragraph']}
|
||||
source={note.snippet} />
|
||||
</p>
|
||||
<div className="flex">
|
||||
<div className={(contact.nickname ? null : "mono") +
|
||||
|
Loading…
Reference in New Issue
Block a user