New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

indented-filter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indented-filter

Indented filter maker for Showdown extension / Hyperpug

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

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.

Keywords

showdown

FAQs

Package last updated on 23 Aug 2019

Related posts