Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/patarapolw/indented-filter
- Owner: patarapolw
- License: mit
- Created: 2019-08-23T01:23:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T08:58:31.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T01:02:22.673Z (2 months ago)
- Topics: hyperpug, showdown-extension
- Language: TypeScript
- Size: 87.9 KB
- Stars: 2
- Watchers: 1
- 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
``````
![](^^x1(source="github") hello^^)
``````
^^x1(source="github").
thank you
verymuch
```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 .