How to use the linkify-it.tlds function in linkify-it

To help you get started, we’ve selected a few linkify-it examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buildo / react-components / src / FormattedText / FormattedText.js View on Github external
import React from 'react';
import { props, t, skinnable } from '../utils';
import flattenDeep from 'lodash.flattendeep';
import tlds from 'tlds';

const linkify = require('linkify-it')().tlds(tlds);

export const Props = {
  children: t.String,
  id: t.maybe(t.String),
  className: t.maybe(t.String),
  style: t.maybe(t.Object)
};

/** A component that transforms `\n` in `<br>` and links in `<a>`
 * @param children - The content of the paragraph
 * @param paragraphSpacing - The space occupied by an empty line
 */
@skinnable()
@props(Props)
export default class FormattedText extends React.Component {
</a>

linkify-it

Links recognition library with FULL unicode support

MIT
Latest version published 11 months ago

Package Health Score

71 / 100
Full package analysis