Skip to content

Commit

Permalink
Additional chores for v4.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrasser committed Nov 19, 2024
1 parent 92cd1ed commit fb3ffea
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
10 changes: 1 addition & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
tab_width = 2

[*.md]
indent_style = space
tab_width = 2

[package.json]
[*.yml,*.md,package.json]
indent_style = space
tab_width = 2
3 changes: 3 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extension": [".mjs"]
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"useTabs": true,
"overrides": [
{
"files": ["*.json", "*.yml"],
"files": ["*.json", "*.yml", "*.md"],
"options": {
"tabWidth": 2,
"useTabs": false
Expand Down
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v4.1.4

- Add support for full width middle dot `` in hashtag plugin
- Development updates for newest Node.js versions

## v4.1.3

Expand Down Expand Up @@ -93,12 +94,12 @@
- React, jQuery and Element interfaces moved to dedicated packages at `linkify-react`,`linkify-jquery` and `linkify-element` respectively:
- Remove default `class="linkified"` from all discovered links. Opt back in by setting the `className` option:
```js
linkifyStr(str, { className: "linkified" });
linkifyStr(str, { className: 'linkified' });
```
- Remove default `target="_blank"` attribute for discovered URLs. Opt back in by setting the `target` option:
```js
linkifyHtml(str, {
target: (href, type) => type === "url" && "_blank",
target: (href, type) => type === 'url' && '_blank',
});
```
- React component: Remove outer `<span>` tag wrapper in favour of tag-less `React.Fragment` for React >=16. To opt back-in, set `tagName='span'`:
Expand Down Expand Up @@ -130,13 +131,13 @@

```js
// Before
import * as linkify from "linkifyjs";
import hashtag from "linkifyjs/plugins/hashtag";
import * as linkify from 'linkifyjs';
import hashtag from 'linkifyjs/plugins/hashtag';
hashtag(linkify);

// After
import * as linkify from "linkifyjs";
import "linkifyjs/plugins/hashtag";
import * as linkify from 'linkifyjs';
import 'linkifyjs/plugins/hashtag';
```

## v2.1.9
Expand Down
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[![npm version](https://badge.fury.io/js/linkifyjs.svg)](https://www.npmjs.com/package/linkifyjs)
[![CI](https://github.com/Hypercontext/linkifyjs/actions/workflows/ci.yml/badge.svg)](https://github.com/Hypercontext/linkifyjs/actions/workflows/ci.yml)
[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=alN1cUFSYVI3Yitudjh6NkJuNURhVy9sRHQ0RXE2L0t2RWpDY3lHM3Rtbz0tLVZScU8rRHAyMWRoYjVVY000elJybHc9PQ==--35ad6d7d5981f5bc0efdb7b6ba78972d8174e7e5)](https://automate.browserstack.com/public-build/alN1cUFSYVI3Yitudjh6NkJuNURhVy9sRHQ0RXE2L0t2RWpDY3lHM3Rtbz0tLVZScU8rRHAyMWRoYjVVY000elJybHc9PQ==--35ad6d7d5981f5bc0efdb7b6ba78972d8174e7e5)
[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=ZVZXNFhhQ044a01nQStVeWJXSng1b01MTWFpZlZRZVg1WnAvdE9aVE9LVT0tLWZpekx6ZHUrZ2E0dDRHMDZRMnJNQlE9PQ==--4d91db279fbd0475f8d8e4b221b5a4c1e0c6a76e)](https://automate.browserstack.com/public-build/ZVZXNFhhQ044a01nQStVeWJXSng1b01MTWFpZlZRZVg1WnAvdE9aVE9LVT0tLWZpekx6ZHUrZ2E0dDRHMDZRMnJNQlE9PQ==--4d91db279fbd0475f8d8e4b221b5a4c1e0c6a76e)
[![Coverage Status](https://coveralls.io/repos/github/Hypercontext/linkifyjs/badge.svg?branch=main)](https://coveralls.io/github/Hypercontext/linkifyjs?branch=main)

Linkify is a JavaScript plugin. Use Linkify to find links in plain-text and
convert them to HTML &lt;a&gt; tags. It automatically highlights URLs,
#hashtags, @mentions and more.

__Jump to__
**Jump to**

- [Features](#features)
- [Demo](#demo)
Expand All @@ -23,16 +23,17 @@ __Jump to__

## Features

* Detect URLs and email addresses
* #hashtag, @mention and #-ticket plugins
* React and jQuery support
* Multi-language and emoji support
* Custom link plugins
* Fast, accurate and small footprint (~20kB minified, ~11kB gzipped)
* 99% test coverage
* Compatible with all modern browsers (Internet Explorer 11 and up)
- Detect URLs and email addresses
- #hashtag, @mention and #-ticket plugins
- React and jQuery support
- Multi-language and emoji support
- Custom link plugins
- Fast, accurate and small footprint (~20kB minified, ~11kB gzipped)
- 99% test coverage
- Compatible with all modern browsers (Internet Explorer 11 and up)

## Demo

[Launch demo](https://linkify.js.org/#demo)

## Installation and Usage
Expand Down Expand Up @@ -78,7 +79,7 @@ linkifyHtml('Any links to github.com here? If not, contact [email protected]', op
Returns the following string:

```js
'Any links to <a href="https://github.com">github.com</a> here? If not, contact <a href="mailto:[email protected]">[email protected]</a>'
'Any links to <a href="https://github.com">github.com</a> here? If not, contact <a href="mailto:[email protected]">[email protected]</a>';
```

To modify the resulting links with a target attribute, class name and more, [use
Expand All @@ -100,17 +101,17 @@ Returns the following array
isLink: true,
href: 'http://github.com',
start: 13,
end: 23
end: 23,
},
{
type: 'email',
value: '[email protected]',
isLink: true,
href: 'mailto:[email protected]',
start: 46,
end: 62
}
]
end: 62,
},
];
```

#### Example 3: Check whether a string is a valid link:
Expand All @@ -130,7 +131,7 @@ linkify.test('[email protected]', 'email'); // true

### Usage with React, jQuery or the browser DOM

[Read the interface documentation](https://linkify.js.org/docs/interfaces.html) to learn how to use linkify when working with a specific JavaScript environment such as React.
[Read the interface documentation](https://linkify.js.org/docs/interfaces.html) to learn how to use linkify when working with a specific JavaScript environment such as React.

### Plugins for @mentions, #hashtags and more

Expand Down

0 comments on commit fb3ffea

Please sign in to comment.