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: 5 months ago
JSON representation
Indented filter utilities, including Showdown extensions / HyperPug filters' maker
- Host: GitHub
- URL: https://github.com/patarapolw/indent-utils
- Owner: patarapolw
- License: mit
- Created: 2020-01-10T20:39:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T04:59:25.000Z (over 3 years ago)
- Last Synced: 2025-03-02T17:06:25.093Z (over 1 year ago)
- Topics: hyperpug, pug, showdownjs
- Language: TypeScript
- Size: 1.38 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eqdict
[](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
 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
}
```