2.0.0 • Published 3 years ago

@atlassian-partner-engineering/atlassian-html-to-gmail v2.0.0

Weekly downloads
2
License
ISC
Repository
bitbucket
Last release
3 years ago

@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
2.0.0

3 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago