
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
tiptap-parser
Advanced tools
HTML parser to React component built on the top of html-react-parser with code syntax highlighting
HTML parser for Tiptap editor build on the of html-react-parser with code syntax highlighting.
The Tiptap editor is primarily used as a text editor for blogging, particularly in back-office applications. However, if the goal is simply to display content (for example, on a Next.js website), it may be excessive to install either the Tiptap or the mui-tiptap-editor along with the entire MUI library.
This library is specifically designed to display the contents of the mui-tiptap-editor, which saves HTML as text. If you're using a developer-oriented blogging platform like Medium, this library is ideal for you.
Try it yourself in this CodeSandbox live demo
npm install tiptap-parser
or
yarn add tiptap-parser
import TiptapParser from "tiptap-parser";
const html = `<h1>Hello world</h1>`;
function App() {
return (
<TiptapParser content={html} />
);
}
const html = `<><h1>Hello there</h1><pre><code>console.log("Log something here")</code></pre></>`;
<TiptapParser content={html} language="typescript" />
const html = `<p><h1>Hello there</h1></p>`;
<TiptapParser
containerClassName="bg-gray-100"
classNames={{
codeClassName: 'p-6',
h1ClassName: 'text-xl',
aClassName: 'underline',
pClassName: 'text-gray-400'
}}
content={html}
/>
props | type | Default value | Description |
---|---|---|---|
content | string | empty | html string to be displayed |
containerClassName | string | empty | styles of the container |
classNames | ClassNameProps | empty | class names of each element withing the container |
language | string | javascript | language of the code. see the list |
props | type | Default value | Description |
---|---|---|---|
codeClassName | string | empty | class name of code element |
h1ClassName | string | empty | class name of h1 element |
h2ClassName | string | empty | class name of h2 element |
h3ClassName | string | empty | class name of h3 element |
h4ClassName | string | empty | class name of h4 element |
h5ClassName | string | empty | class name of h5 element |
h6ClassName | string | empty | class name of h6 element |
pClassName | string | empty | class name of p element |
ulClassName | string | empty | class name of ul element |
spanClassName | string | empty | class name of span element |
divClassName | string | empty | class name of div element |
aClassName | string | empty | class name of a element |
tableClassName | string | empty | class name of table element |
imageClassName | string | empty | class name of image element |
other props | HTMLReactParserOptions | empty | all html-react-parser props |
Get started here.
FAQs
HTML parser to React component built on the top of html-react-parser with code syntax highlighting
The npm package tiptap-parser receives a total of 138 weekly downloads. As such, tiptap-parser popularity was classified as not popular.
We found that tiptap-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.