![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-break-newlines
Advanced tools
Break a string to lines at newlines, and either wrap each line by a configurable wrapper or append a `` to each line.
Break a string to lines at newlines, and either wrap each line by a configurable
wrapper or append a <br />
to each line.
npm install react-break-newlines
import breakNewlines from 'react-break-newlines';
// The string to break.
var str = 'paragraphs\nwith\nnewlines';
// Case 1: Break without a wrapper.
breakNewlines( str );
// Gives [
// paragraphs<br key="0">,
// with<br key="1">,
// newlines<br key="2">
// ]
// Case 2: Break with a <p> wrapper.
breakNewlines( str, 'p' ); // Or breakNewlines( str, <p /> );
// Both give
// [
// <p key="0">paragraphs</p>,
// <p key="1">with</p>,
// <p key="2">newlines</p>
// ]
// Case 3: Break with a wrapper made of a React component.
const Wrapper = props => <div>Wrapper { props.children }</div>;
breakNewlines( str, Wrapper ); // Or breakNewlines( str, <Wrapper /> );
// Both give
// [
// <Wrapper key="0"><div>Wrapper paragraphs</div></Wrapper>,
// <Wrapper key="1"><div>Wrapper with</div></Wrapper>,
// <Wrapper key="2"><div>Wrapper newlines</div></Wrapper>
// ]
MIT. See LICENSE.md for details.
FAQs
Break a string to lines at newlines, and either wrap each line by a configurable wrapper or append a `` to each line.
We found that react-break-newlines 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.