
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
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 245 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.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.