Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

kreeti/formatted-text

 
 

Repository files navigation

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

<FormattedText>
  Email me (foo@example.com) or visit foo.example.com.
</FormattedText>
<div>
  <p>
    Email me (<a href="mailto:foo@example.com">foo@example.com</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

 
 
 

Contributors

Languages

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