https://github.com/rotorz/markdown-it-block-image
Plugin for markdown-it that detects and outputs block level images.
https://github.com/rotorz/markdown-it-block-image
Last synced: about 2 months ago
JSON representation
Plugin for markdown-it that detects and outputs block level images.
- Host: GitHub
- URL: https://github.com/rotorz/markdown-it-block-image
- Owner: rotorz
- License: mit
- Created: 2016-07-12T07:00:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-11-09T14:14:56.000Z (over 4 years ago)
- Last Synced: 2025-03-27T08:11:16.806Z (2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 8
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-block-image [](https://travis-ci.org/rotorz/markdown-it-block-image)
[](https://badge.fury.io/js/markdown-it-block-image)
[](https://david-dm.org/rotorz/markdown-it-block-image)
[](https://david-dm.org/rotorz/markdown-it-block-image#info=devDependencies)Plugin for markdown-it that detects and outputs block level images.
Example input:
```markdown
Here is an inline image: .
```Output (with default options):
```htmlHere is an inline image:
.
![]()
```Output (with a container element and classes):
```htmlHere is an inline image:
.
![]()
```## Install
```
$ npm install --save markdown-it-block-image
```## Usage
```javascript
var md = require("markdown-it")();
var blockImagePlugin = require("markdown-it-block-image");md.use(blockImagePlugin, {
outputContainer: true,
containerClassName: "image-container"
});var input = "";
var output = md.render(input);console.log(output);
```## Options
Option | Type | Default | Description
:--------------------|:-------------------|:----------------|:---------------------------------------------------------------------------------------------------------------------
`outputContainer` | `string` \| `null` | `null` | Indicates the type of container element to add; for instance, `"div"`. Specify `null` to disable output of container.
`containerClassName` | `string` \| `null` | `"block-image"` | Class name for image container element.## Contribution Agreement
This project is licensed under the MIT license (see LICENSE). To be in the best
position to enforce these licenses the copyright status of this project needs to
be as simple as possible. To achieve this the following terms and conditions
must be met:- All contributed content (including but not limited to source code, text,
image, videos, bug reports, suggestions, ideas, etc.) must be the
contributors own work.- The contributor disclaims all copyright and accepts that their contributed
content will be released to the public domain.- The act of submitting a contribution indicates that the contributor agrees
with this agreement. This includes (but is not limited to) pull requests, issues,
tickets, e-mails, newsgroups, blogs, forums, etc.