Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/patarapolw/indented-filter

Indented filter maker for Showdown extension / Hyperpug
https://github.com/patarapolw/indented-filter

hyperpug showdown-extension

Last synced: 14 days ago
JSON representation

Indented filter maker for Showdown extension / Hyperpug

Awesome Lists containing this project

README

        

# indented-filter

Indented filter maker for [Showdown](https://github.com/showdownjs/showdown) extension / [Hyperpug](https://github.com/patarapolw/hyperpug)

## Installation

```
npm i indented-filter
```

## Usage

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

Example matched cases,

```
^^x1 hello
```

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

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

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

much
```

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

For my use case, see,

For more information about custom [Showdown](https://github.com/showdownjs/showdown) extensions, see .