Skip to content

Indented filter maker for Showdown extension / Hyperpug

License

Notifications You must be signed in to change notification settings

patarapolw/indented-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Indented filter maker for Showdown extension / Hyperpug

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published