Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/patarapolw/indent-utils

Indented filter utilities, including Showdown extensions / HyperPug filters' maker
https://github.com/patarapolw/indent-utils

hyperpug pug showdownjs

Last synced: 22 days ago
JSON representation

Indented filter utilities, including Showdown extensions / HyperPug filters' maker

Awesome Lists containing this project

README

        

# eqdict

[![npm version](https://badge.fury.io/js/indent-utils.svg)](https://badge.fury.io/js/indent-utils)

Indented filter utilities, including Showdown extensions / HyperPug filters' maker

## Usage

```typescript
import { createIndentedFilter } from "indent-utils";
const filterFn = createIndentedFilter("x1", (coveredText, attrs) => {
return customFn(coveredText, attrs)
});
const showdownX1Extension = {
type: "lang",
filter: filterFn
};
```

Example matched cases,

```markdown
^^x1 hello
```

```markdown
^^x1(source="github") hello
```

```markdown
![](^^x1(source="github") hello^^)
```

```markdown
^^x1(source="github").
thank you
very

much
```

For more test cases, see [/tests/index.spec.yaml](/tests/index.spec.yaml)

## Usage on the browser

```html

const filterFn = createIndentedFilter("x1", (coveredText, attrs) => {
return customFn(coveredText, attrs)
})
const showdownX1Extension = {
type: "lang",
filter: filterFn
}

```