You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constjson2md=require("json2md")console.log(json2md([{h1: "JSON To Markdown"},{blockquote: "A JSON to Markdown converter."},{img: [{title: "Some image",source: "https://example.com/some-image.png"},{title: "Another image",source: "https://example.com/some-image1.png"},{title: "Yet another image",source: "https://example.com/some-image2.png"}]},{h2: "Features"},{ul: ["Easy to use","You can programmatically generate Markdown content","..."]},{h2: "How to contribute"},{ol: ["Fork the project","Create your branch","Raise a pull request"]},{h2: "Code blocks"},{p: "Below you can see a code block example."},{"code": {language: "js",content: ["function sum (a, b) {"," return a + b","}","sum(1, 2)"]}}]))
Actual output:
# JSON To Markdown
> A JSON to Markdown converter.
![](https://example.com/some-image.png "Some image")
![](https://example.com/some-image.png "Some image")
![](https://example.com/some-image1.png "Another image")
![](https://example.com/some-image1.png "Another image")
![](https://example.com/some-image2.png "Yet another image")
![](https://example.com/some-image2.png "Yet another image")
## Features
- Easy to use
- You can programmatically generate Markdown content
- ...
## How to contribute
1. Fork the project
2. Create your branch
3. Raise a pull request
## Code blocks
Below you can see a code block example.
```js
function sum (a, b) {
return a + b
}
sum(1, 2)
```
Note the duplicated images; three in the input, three pairs, six total images in the output.
The text was updated successfully, but these errors were encountered:
johnbeech
added a commit
to johnbeech/json2md
that referenced
this issue
Feb 14, 2023
Test file:
Actual output:
Note the duplicated images; three in the input, three pairs, six total images in the output.
The text was updated successfully, but these errors were encountered: