Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atlassian-partner-engineering/atlassian-html-to-gmail

Package Overview
Dependencies
Maintainers
7
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlassian-partner-engineering/atlassian-html-to-gmail

## Usage

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

@atlassian-partner-engineering/atlassian-html-to-gmail

Usage

Example of truncating the html

import { truncate } from '@atlassian-partner-engineering/atlassian-html-to-gmail'

const html = '<p>external <a href="http://example.com">link to the resource</a></p>'

truncate(html, 16) // <p>external <a href="http://example.com">link...</a></p>

Example of converting the html (pass baseUrl only for Jira description field)

import { convert } from '@atlassian-partner-engineering/atlassian-html-to-gmail'

const html = '<p><em>external</em> <a href="http://example.com">link to the resource</a></p>'

convert(html, { baseUrl: 'https://example.atlassian.net' }) // <p><i>external</i> <a href=\"http://example.com\">link to the resource</a></p>

Example of combining both functions

import { convert, truncate } from '@atlassian-partner-engineering/atlassian-html-to-gmail'

const html = '<p><em>external</em> <a href="http://example.com">link to the resource</a></p>'

truncate(convert(html), 16) // <p><i>external</i> <a href="http://example.com">link...</a></p>

Example of converting html to plain text

import { transformHtmlToText } from '@atlassian-partner-engineering/atlassian-html-to-gmail'

const html = '<p><em>external</em> <a href="http://example.com">link to the resource</a></p>'

transformHtmlToText(html) // external link to the resource

Test

> npm test

Publish

> npm run build
> npm version
> npm publish --access public

FAQs

Package last updated on 05 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc