Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zr87 committed Aug 22, 2024
1 parent 3d86b53 commit c64ad4d
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

## Description

A case-insensitive accent folding function that replaces accented characters with their unaccented equivalents
A case-insensitive accent folding functions to replace accented characters with their unaccented equivalents
or hightlight matched terms in a string, ignoring accents.

### Key Features:

- Accent-insensitive matching
- Customizable highlight wrapping (can use any HTML tag)
- Preserves original string formatting in the output
- Handles various Unicode characters, including fullwidth ASCII
- wraps string fragment in `<b>` html tag by default.

### Potential Use Cases:

- Search functionality in applications where accents should be ignored
- Highlighting matched terms in search results

## Usage
## Installation

Install with npm:

Expand All @@ -40,9 +30,13 @@ yarn add accent-folding
## Public Methods

### `replace`

Replaces accented characters in a string with their unaccented equivalents.

#### Key Features:
- Handles various Unicode characters, including fullwidth ASCII
- Preserves original string formatting in the output


```js
import AccentFolding from 'accent-folding';

Expand All @@ -52,9 +46,22 @@ af.replace('Fulanilo López'); // --> "Fulanilo Lopez"
```

### `highlightMatch`

Highlights matched terms in a string, ignoring accents.

#### Key Features:

- Accent-insensitive matching
- Customizable highlight wrapping (can use any HTML tag)
- Preserves original string formatting in the output
- Handles various Unicode characters, including fullwidth ASCII
- wraps string fragment in `<b>` html tag by default.

#### Potential Use Cases:

- Search functionality in applications where accents should be ignored
- Highlighting matched terms in search results


```js
import AccentFolding from 'accent-folding';

Expand Down

0 comments on commit c64ad4d

Please sign in to comment.