indented-filter
v0.1.1
Published
Indented filter maker for Showdown extension / Hyperpug
Downloads
11
Maintainers
Readme
indented-filter
Indented filter maker for Showdown extension / Hyperpug
Installation
npm i indented-filter
Usage
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
For my use case, see, https://github.com/patarapolw/zhdiary/blob/master/src/plugins/showdown-ext.js#L23
For more information about custom Showdown extensions, see https://github.com/showdownjs/showdown/wiki/Extensions.