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

## Usage

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @atlassian-partner-engineering/atlassian-html-to-gmail in KB

Readme

@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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.