JSPM

convert-links

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q31233F
  • License MIT

Detect and convert links and email addresses to HTML hyperlinks sanely.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (convert-links) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Convert links

    Detect and convert links and email addresses to HTML hyperlinks sanely.

    convertLinks("The greatest page in the world is http://www.cwtsite.com I swear!")
    // The greatest page in the world is <a href="http://www.cwtsite.com" target="_blank">http://www.cwtsite.com</a> I swear!

    Add CSS classes to the link:

    convertLinks("http://www.cwtsite.com", ['with-style'])
    // <a href="http://www.cwtsite.com" target="_blank" class="with-style">http://www.cwtsite.com</a>

    Tests

    node test.js