https://github.com/patarapolw/indented-filter
Indented filter maker for Showdown extension / Hyperpug
https://github.com/patarapolw/indented-filter
hyperpug showdown-extension
Last synced: 5 months ago
JSON representation
Indented filter maker for Showdown extension / Hyperpug
- Host: GitHub
- URL: https://github.com/patarapolw/indented-filter
- Owner: patarapolw
- License: mit
- Created: 2019-08-23T01:23:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T08:58:31.000Z (over 3 years ago)
- Last Synced: 2025-04-06T22:48:07.653Z (about 1 year ago)
- Topics: hyperpug, showdown-extension
- Language: TypeScript
- Size: 87.9 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```
```
 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 .