Skip to content

Commit 101cf2a

Browse files
committed
feat: update readme
1 parent a0f53b5 commit 101cf2a

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

README.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
[![npm](https://img.shields.io/npm/v/react-link-parser.svg?style=flat-square)](https://www.npmjs.com/package/react-link-parser)
55
[![npm](https://img.shields.io/npm/l/react-link-parser.svg?style=flat-square)](https://github.com/danbovey/react-link-parser/blob/master/LICENSE)
66

7-
A tiny React component (~1KB) that parses plain text into links, emails or renders elements that **start** or **end** with a specific character or word in the way you want.
7+
A tiny React component (~1KB) that parses plain text into links, emails or renders elements that **start** or **end** with a specific character or word in the way you want.
88

99
## How it works?
10-
Maps over every word in the given string and matches watchers to see if it matches on watcher requirements, it uses the watcher render function.
10+
11+
Iterates over every word in the given string and matches watchers to render it customized with matched watcher render function.
1112

1213
## Install
1314

@@ -97,24 +98,19 @@ export function App() {
9798
}
9899
```
99100

100-
101101
## Props
102102

103-
| Name | Required | Type | Default | Description |
104-
| :---------------- | :------- | :----------- | :-------- | :---------------------------------------- |
105-
| `children`       | Yes | `Node`   |           | Only the text will be rendered |
106-
| `newLineWatcher` | | `String` | `\\n` | If `parseNewLine` is true, what character(s) should be considered as new line.
107-
| `parseNewLine` | | `Boolean` | `true` | Whether new line should be parsed as `<br />`|
108-
| `watchers`       | | `Array`   | link watcher    | An array of [watchers](#parse-tags-mentions-and-more) |
109-
103+
| Name | Required | Type | Default | Description |
104+
| :--------------- | :------- | :-------- | :--------------- | :----------------------------------------------------------------------------- |
105+
| `children`       | Yes | `Node`   |           | Only the text will be rendered |
106+
| `newLineWatcher` | | `String` | `\\n` | If `parseNewLine` is true, what character(s) should be considered as new line. |
107+
| `parseNewLine` | | `Boolean` | `true` | Whether new line should be parsed as `<br />` |
108+
| `watchers`       | | `Array`   | link watcher     | An array of [watchers](#parse-tags-mentions-and-more) |
110109

111110
### Watcher props
112111

113-
| Name | Required | Type | Default | Description |
114-
| :---------------- | :------- | :----------- | :-------- | :---------------------------------------- |
115-
| `render`       | Yes | `Function`   |  anchor       | A function to customize watcher render |
116-
| `type`       | | `startsWith` or `endsWith` | `startsWith`    | Where should it watch to find the `watchFor` clue |
117-
| `watchFor` | Yes | `link` or `email` or `String` |`link` | What to look up in the string |
118-
119-
120-
112+
| Name | Required | Type | Default | Description |
113+
| :------------- | :------- | :---------------------------- | :--------------- | :------------------------------------------------ |
114+
| `render`       | Yes | `Function`   |  anchor       | A function to customize watcher render |
115+
| `type`       | | `startsWith` or `endsWith` | `startsWith`     | Where should it watch to find the `watchFor` clue |
116+
| `watchFor` | Yes | `link` or `email` or `String` | `link` | What to look up in the string |

0 commit comments

Comments
 (0)