
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
reactjs-editor
Advanced tools
A simple react library that lets you highlight text, make text bold, and add comment on any text as a sticky notes
$ npm i reactjs-editor
$ import { Editor } from 'reactjs-editor';
<Editor
htmlContent={`<main>
<div style="border-radius:30px;width:50%;padding:30px; margin:40px auto; box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;">
<h1 style="color:blue;">Select any Text Below</h1>
<div style="display:flex;">
<p style="padding:10px;text-align:left;color:#000;line-height:25px;">
You can select any text and add comments. You can make text bold. Tou can highlight any
text using color you choose. These are the feature of React Editor. You ca highlight that React Editor text if you want to.
</p>
<p style="padding:10px;text-align:left;color:#000;line-height:25px;">
You can add inline styles or class names as well. Tou can highlight any
text using color you choose. These are the feature of React Editor. You ca highlight that React Editor text if you want to.
</p>
</div>
<div>
</main>`}
/>
Make sure your htmlContent is wrapped inside
<main>
tag <main>
<main>
tag *** }</main>
<Editor
colors={["black","gold","red"]}
....
/>
/* In your css file */
.black{
background-color:#000,
color:#fff,
},
.red{
background-color:red,
color:#fff,
}
.gold{
background-color:gold,
color:#fff,
}
//add as much as you like
import { Editor, useDomValue } from 'reactjs-editor';
...
const { dom, setDom } = useDomValue();
// eslint-disable-next-line react-hooks/exhaustive-deps
const updatedDomValue = {
key: dom?.key,
props: dom?.props,
ref: dom?.ref,
type: dom?.type,
}
console.log("%j", updatedDomValue );
// get your changed dom like this and save it if you like to in your database or some place
useEffect(()=>{
function updateDom(updatedDomValue:any){
setDom(updatedDomValue); //set your dom like this
}
updateDom(updatedDomValue) // call this function where ever you like
},[])
1. Inspect html element
2. Find className of specific elements
3. Override css present there from your own css files
In future update, I will create option to pass all components in a props
MIT
vivekneupane11@gmail.com · LinkedIn @vivekneupane11 · Youtube @vivekneupane11 · GitHub @vivekneupane11 ·
FAQs
A simple react library that lets you highlight text, make text bold, and add comment on any text as a sticky notes
The npm package reactjs-editor receives a total of 20 weekly downloads. As such, reactjs-editor popularity was classified as not popular.
We found that reactjs-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.