Skip to content

Commit 6d04e7a

Browse files
author
Harshit Vishwakarma
committed
(docs): update readme
1 parent c75f8da commit 6d04e7a

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-highlightable-input
22

3-
A custom react input component that allows highlighting or styling of text as it is typed.
3+
A custom react input component that allows highlighting or styling of specific text as it is typed. For example, you can highlight mentions starting with @ symbol in a text input as the user types them.
44

55
## Install
66

@@ -156,6 +156,22 @@ This function takes a string of text, a regular expression pattern to match ment
156156

157157
A new string where the mentions are styled with the specified styles.
158158

159+
## Utility Functions
160+
161+
### `cleanHtml`
162+
163+
```ts
164+
function cleanHtml(html: string): string
165+
```
166+
167+
**Parameters:**
168+
169+
- `html`: The input HTML string.
170+
171+
**Returns:**
172+
173+
A new string where all HTML tags are removed, `<div>` tags are replaced with newlines, and `&lt;` and `&gt;` entities are replaced with `<` and `>` characters, respectively.
174+
159175
## Usage Instructions for the HighlightableTextInput component
160176

161177
### 1. Setting border and padding

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-highlightable-input",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"type": "module",
55
"main": "dist/main.js",
66
"types": "dist/main.d.ts",

0 commit comments

Comments
 (0)