Skip to content

the matcher which has reg expression and some methods about markdown.

Notifications You must be signed in to change notification settings

akinoccc/markdown-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown-Matcher

## Install
npm i markdown-matcher --save

Usage

regexp constant

you can import the regular expression from markdown-matcher for other purposes.

import { HEADER, H1, H2, LINK } from 'markdown-matcher';

match

import { H1, match } from 'markdown-matcher';
const str = '# header1 \n 1234';
match(str, 'h1'); // => # header1

hasHeader

Determine if header exists.

import { hasHeader } from 'markdown-matcher';
const str = '# header1 \n 1234';
hasHeader(str, 'header'); // => true
hasHeader(str, 'h1'); // => true
hasHeader(str, 'h2'); // => false

hasLink

Determine if link exists.

import { hasLink } from 'markdown-matcher';
const str = '[](http://abc.com) \n 1234';
hasLink(str); // => true

hasCodeBlock

Determine if code block exists.

import { hasCodeBlock } from 'markdown-matcher';
const str = '```js var a = 1``` \n 1234';
hasCodeBlock(str); // => true

more

hasImage, hasItalic, hasBold, hasHeightLight

About

the matcher which has reg expression and some methods about markdown.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published