Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pixiedevpraveen/tagbalancer

Balance tags of html string
https://github.com/pixiedevpraveen/tagbalancer

Last synced: about 1 month ago
JSON representation

Balance tags of html string

Awesome Lists containing this project

README

        

# tag-balancer
![Package Size](https://deno.bundlejs.com/badge?q=tag-balancer)
[![JSR](https://jsr.io/badges/@praveen/tag-balancer)](https://jsr.io/@praveen/tag-balancer)
[![JSR Score](https://jsr.io/badges/@praveen/tag-balancer/score)](https://jsr.io/@praveen/tag-balancer/score)

Balance tags of html string.

To install:

```bash
# npm
npm install tag-balancer

# bun
bun add tag-balancer

# yarn
yarn add tag-balancer

# pnpm
pnpm add tag-balancer
```

## Example
```ts
const htmlStr = `








`;

// removes the extra closing div
const outputStr = tagBalancer(htmlStr); /*








*/

```