Indented filter utilities, including Showdown extensions / HyperPug filters' maker
import { createIndentedFilter } from "indent-utils";
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.yaml
<script src="https://unpkg.com/indent-utils@:version/umd/index.min.js"></script>
<script>
const filterFn = createIndentedFilter("x1", (coveredText, attrs) => {
return customFn(coveredText, attrs)
})
const showdownX1Extension = {
type: "lang",
filter: filterFn
}
</script>