Indented filter utilities, including Showdown extensions / HyperPug filters' maker
npm install indent-utils
Indented filter utilities, including Showdown extensions / HyperPug filters' maker
``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
`html``