Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A library to parse/stringify metadata of markdown code block

License

NotificationsYou must be signed in to change notification settings

show-docs/markdown-code-block-meta

Repository files navigation

A library to parse/stringify metadata of markdown code block.

npmgithubnode

Installation

npm install markdown-code-block-meta --save

Usage

Parsing markdown withremark.

```js title="Here is an example"```

A Code block will turn into:

{"lang":"js","meta":"title=\"Here is an example\""}

Parsing metadata like this:

import{getValue,parse,stringify}from'markdown-code-block-meta';constinput='-8=。是 ==0 ===f=5 =9 dd k=dsds op="s 7" d-p="" sss=`7 u-` rj= lp=\' ds ds\' t="`"';constresult=parse(input);/* result = Map {  '-8' => '。是',  '==0' => undefined,  '===f=5' => undefined,  '=9' => undefined,  'dd' => undefined,  'k' => 'dsds',  'op' => '"s 7"',  'd-p' => '""',  'sss' => '`7 u-`',  'rj=' => undefined,  'lp' => '\' ds ds\'',  't' => '"`"'} */stringify(result);// same as inputgetValue('"abc"');// abcgetValue('`abc`');// abcgetValue("'abc'");// abc

Related

About

A library to parse/stringify metadata of markdown code block

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp