1
0
Fork 0
A markdown-it plugin to write block tag. https://www.npmjs.com/package/@sup39/markdown-it-block-tag
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2021-01-13 00:55:37 +09:00
test init (still WIP) 2021-01-13 00:46:35 +09:00
.eslintignore init (still WIP) 2021-01-13 00:46:35 +09:00
.eslintrc.js init (still WIP) 2021-01-13 00:46:35 +09:00
.gitignore init (still WIP) 2021-01-13 00:46:35 +09:00
index.js init (still WIP) 2021-01-13 00:46:35 +09:00
LICENSE init (still WIP) 2021-01-13 00:46:35 +09:00
package.json add files field to package.json 2021-01-13 00:55:37 +09:00
README.md init (still WIP) 2021-01-13 00:46:35 +09:00
yarn.lock init (still WIP) 2021-01-13 00:46:35 +09:00

markdown-it-block

A markdown-it plugin to write block tag.

Still work in progress.

Syntax

::: tag
inline or block
:::

will become

<tag>
inline or block
</tag>

Note that the first p is hidden.

If you want the first p present, you should use plain html instead.

<tag>

inline or block
</tag>

Usage

const md = require('markdown-it')();
const mbt = require('@sup39/markdown-it-block-tag');

console.log(md.use(mbt).render(`
::: div
- a
- b
:::
`));

Expected output:

<div>
<ul>
<li>a</li>
<li>b</li>
</ul>
</div>

TODO

nested / contiguous block tag

:: ul
::: li
item1
::: li
item2
::: li
item3
::

should become

<ul>
<li>
item1
</li>
<li>
item2
</li>
<li>
item3
</li>
</ul>