Skip to content

A React component for formatting paragraphs, line breaks and links.

License

Notifications You must be signed in to change notification settings

kreeti/formatted-text

 
 

Repository files navigation

A React component for formatting paragraphs, line breaks and links.

<FormattedText>
  Email me ([email protected]) or visit foo.example.com.
</FormattedText>
<div>
  <p>
    Email me (<a href="mailto:[email protected]">[email protected]</a>) or visit <a href="http://foo.example.com">foo.example.com</a>.
  </p>
</div>

Props

renderLink

A function that receives {url, text} and returns what to render in place of the found link. By default this function simply returns <a href={url}>{text}</a>, but can be customized to turn YouTube/SoundCloud/etc links into embedded media. See the example page for a demonstration.

About

A React component for formatting paragraphs, line breaks and links.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 75.8%
  • HTML 23.4%
  • Makefile 0.8%