🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

remark-multiline-code

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-multiline-code

Remark plugin to improve `code` blocks

latest
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

remark-multiline-code

remark plugin to turn inlineCode with multiline into code type

Installation

npm install remark-multiline-code --save

Usage

Say we have the following file, example.md:

# Post title

Some post content...

`const param = true

console.log(param)`

`const client = () => {}`

And our script, example.js, looks as follows:

const vfile = require('to-vfile')
const remark = require('remark')
const multilineCode = require('remark-multiline-code')

remark()
  .use(multilineCode)
  .use({ settings: { fences: true } })
  .process(vfile.readSync('example.md'), function (err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

# Post title

Some post content...

```
const param = true
console.log(param)
```

```
const client = () => {}
```

As you can see inlineCode which contained multilines and inlineCode that was the only children in paragraph were turned into code blocks.

Keywords

remark

FAQs

Package last updated on 02 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts