
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
markdownz
Advanced tools
Markdown viewer, editor, and help components for the Zooniverse. Requires React 16.8 or higher.
Available on npm, include as a dependency using npm install --save markdownz
This package contains three publicly accessible components: a Markdown viewer and a Markdown editor for Zooniverse-flavored Markdown, and a MarkdownHelp component.
Viewer:
Parse markdown to HTML with markdown-it, then render the result as a React component tree with rehype-react.
import { Markdown } from 'markdownz';
<Markdown>{A String of `Markdown`}</Markdown>
Debug the viewer with the debug prop:
import { Markdown } from 'markdownz';
<Markdown debug>{A String of `Markdown`}</Markdown>
Editor:
import { MarkdownEditor } from 'markdownz';
<MarkdownEditor rows={20} value="A String of `Markdown`" onChange={this.handleMarkdownChange} />
Help:
import { MarkdownHelp } from 'markdownz'
<MarkdownHelp talk={true} title={<h1>Guide to Markdown</h1>} />
Utilities:
import { utils } from 'markdownz';
const content = `
# A test document
This is a test [with a link](https://www.zooniverse.org).
`
const html = utils.getHTML({ content });
// render HTML as JSX with utils.getComponentTree
import { utils } from 'markdownz';
const html = '<p>This is a test paragraph, with <a href="https://www.zooniverse.org">a link.</a>';
const markdownChildren = utils.getComponentTree({ html });
return <div>{markdownChildren}</div>;
Hooks:
The useMarkdownz hook accepts the same props as the Markdown component. It returns the parsed content as a React component tree, which can be rendered as JSX or with React.createElement;
import { useMarkdownz } from 'markdownz';
const markdownChildren = useMarkdownz({ content: 'This is some markdown', debug: true });
return <>{markdownChildren}</>;
| property | default | effect |
|---|---|---|
| children | null | Markdown String to Render |
| components | null | Rehype component mappings for the parsed output |
| content | '' | Markdown String to Render used if this.props.children is null |
| debug | false | Return error messages, if true, for easier debugging |
| settings | {} | Rehype settings for the parsed output |
| tag | div | HTML tag to wrap markdown content with |
| className | '' | css classes for the element |
| project | null | Panoptes project for links |
| baseURI | 'null' | Set the base URI for building links |
| inline | false | Toggles rendering between markdownIt.render and markdownIt.renderInline |
| property | default | effect |
|---|---|---|
| name | '' | Name for the <textarea> in the Markdown editor |
| value | '' | Value of the <textarea> in the Markdown editor |
| placeholder | '' | Placeholder text in the <textarea> |
| row | 5 | Height of the <textarea> |
| cols | '' | null |
| onChange | NOOP | Change listener |
| project | null | Panoptes project for links |
| baseURI | 'null' | Set the base URI for building links |
| className | '' | css classes for the element |
| helpText | null | String or Component for custom help text for the editor |
| onHelp | NOOP | Function to run when help button is clicked |
| previewing | false | Toggle the editor's preview mode |
| property | default | effect |
|---|---|---|
| talk | false | Toggle the inclusion of Talk-specific Markdown help content |
| title | <h1 className="markdown-editor-title">Guide to using Markdown</h1> | Title displayed at the top of the MarkdownHelp component |
We use markdown-it for rendering Markdown and twemoji for cross-browser emoji support.
TODO: Document custom extensions.
See CONTRIBUTING.md
npm --no-git-tag-version version [major|minor|patch])../lib), run tests, and create a fresh build, run "rm -rf lib && npm test && npm run build".npm publish --dry-run to check that the package is ready to publish.npm publish to publish the new version to npm.Copyright 2015 by The Zooniverse. Licensed under the Apache Public License v2. See LICENSE for details.
FAQs
Markdown viewer and editor for the Zooniverse
The npm package markdownz receives a total of 336 weekly downloads. As such, markdownz popularity was classified as not popular.
We found that markdownz demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.