Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2md

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2md - npm Package Compare versions

Comparing version 1.9.0 to 1.9.1

6

lib/converters.js

@@ -38,6 +38,8 @@ "use strict";

strong: "**",
italic: "*"
italic: "*",
underline: "_",
strikethrough: "~~"
};
return text.replace(/<\/?strong\>/gi, formats.strong).replace(/<\/?bold\>/gi, formats.strong).replace(/<\/?em\>/gi, formats.italic).replace(/<\/?italic\>/gi, formats.italic);
return text.replace(/<\/?strong\>/gi, formats.strong).replace(/<\/?bold\>/gi, formats.strong).replace(/<\/?em\>/gi, formats.italic).replace(/<\/?italic\>/gi, formats.italic).replace(/<\/?u\>/gi, formats.underline).replace(/<\/?strike\>/gi, formats.strikethrough);
};

@@ -44,0 +46,0 @@

@@ -12,18 +12,18 @@ "use strict";

*
* | Type | Element | Data | Example |
* |--------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
* | `h1` | Heading 1 | The heading text as string. | `{ h1: "heading 1" }` |
* | `h2` | Heading 2 | The heading text as string. | `{ h2: "heading 2" }` |
* | `h3` | Heading 3 | The heading text as string. | `{ h3: "heading 3" }` |
* | `h4` | Heading 4 | The heading text as string. | `{ h4: "heading 4" }` |
* | `h5` | Heading 5 | The heading text as string. | `{ h5: "heading 5" }` |
* | `h6` | Heading 6 | The heading text as string. | `{ h6: "heading 6" }` |
* | `p` | Paragraphs | The paragraph text as string or array (multiple paragraphs). | `{ p: "Hello World"}` or multiple paragraphs: `{ p: ["Hello", "World"] }` |
* | `blockquote` | Blockquote | The blockquote as string or array (multiple blockquotes) | `{ blockquote: "Hello World"}` or multiple blockquotes: `{ blockquote: ["Hello", "World"] }` |
* | `img` | Image | An object or an array of objects containing the `title`, `source` and `alt` fields. | `{ img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } }` |
* | `ul` | Unordered list | An array of strings representing the items. | `{ ul: ["item 1", "item 2"] }` |
* | `ol` | Ordered list | An array of strings representing the items. | `{ ol: ["item 1", "item 2"] }` |
* | `code` | Code block element | An object containing the `language` (`String`) and `content` (`Array` or `String`) fields. | `{ code: { "language": "html", "content": "<script src='dummy.js'></script>" } }` |
* | `table` | Table | An object containing the `headers` (`Array` of `String`s) and `rows` (`Array` of `Array`s or `Object`s) and optionally `aligns` (`Array` of `String`s). | `{ table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } }` or `{ table: { headers: ["a", "b"], rows: [["col1", "col2"]] } }` or `{ table: { headers: ["a", "b"], aligns: ["left", "center"], rows: [["col1", "col2"]] } }` |
* | `link` | Link | An object containing the `title` and the `source` fields. | `{ title: 'hello', source: 'https://ionicabizau.net' } |
* | Type | Element | Data | Example |
* |--------------|--------------------|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
* | `h1` | Heading 1 | The heading text as string. | `{ h1: "heading 1" }` |
* | `h2` | Heading 2 | The heading text as string. | `{ h2: "heading 2" }` |
* | `h3` | Heading 3 | The heading text as string. | `{ h3: "heading 3" }` |
* | `h4` | Heading 4 | The heading text as string. | `{ h4: "heading 4" }` |
* | `h5` | Heading 5 | The heading text as string. | `{ h5: "heading 5" }` |
* | `h6` | Heading 6 | The heading text as string. | `{ h6: "heading 6" }` |
* | `p` | Paragraphs | The paragraph text as string or array (multiple paragraphs). | `{ p: "Hello World"}` or multiple paragraphs: `{ p: ["Hello", "World"] }` |
* | `blockquote` | Blockquote | The blockquote as string or array (multiple blockquotes) | `{ blockquote: "Hello World"}` or multiple blockquotes: `{ blockquote: ["Hello", "World"] }` |
* | `img` | Image | An object or an array of objects containing the `title`, `source` and `alt` fields. | `{ img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } }` |
* | `ul` | Unordered list | An array of strings or lists representing the items. | `{ ul: ["item 1", "item 2"] }` |
* | `ol` | Ordered list | An array of strings or lists representing the items. | `{ ol: ["item 1", "item 2"] }` |
* | `code` | Code block element | An object containing the `language` (`String`) and `content` (`Array` or `String`) fields. | `{ code: { "language": "html", "content": "<script src='dummy.js'></script>" } }` |
* | `table` | Table | An object containing the `headers` (`Array` of `String`s) and `rows` (`Array` of `Array`s or `Object`s). | `{ table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } }` or `{ table: { headers: ["a", "b"], rows: [["col1", "col2"]] } }` |
* | `link` | Link | An object containing the `title` and the `source` fields. | `{ title: 'hello', source: 'https://ionicabizau.net' }
*

@@ -30,0 +30,0 @@ *

{
"name": "json2md",
"version": "1.9.0",
"version": "1.9.1",
"description": "A JSON to Markdown converter.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -185,18 +185,18 @@ <!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->

| Type | Element | Data | Example |
|--------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `h1` | Heading 1 | The heading text as string. | `{ h1: "heading 1" }` |
| `h2` | Heading 2 | The heading text as string. | `{ h2: "heading 2" }` |
| `h3` | Heading 3 | The heading text as string. | `{ h3: "heading 3" }` |
| `h4` | Heading 4 | The heading text as string. | `{ h4: "heading 4" }` |
| `h5` | Heading 5 | The heading text as string. | `{ h5: "heading 5" }` |
| `h6` | Heading 6 | The heading text as string. | `{ h6: "heading 6" }` |
| `p` | Paragraphs | The paragraph text as string or array (multiple paragraphs). | `{ p: "Hello World"}` or multiple paragraphs: `{ p: ["Hello", "World"] }` |
| `blockquote` | Blockquote | The blockquote as string or array (multiple blockquotes) | `{ blockquote: "Hello World"}` or multiple blockquotes: `{ blockquote: ["Hello", "World"] }` |
| `img` | Image | An object or an array of objects containing the `title`, `source` and `alt` fields. | `{ img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } }` |
| `ul` | Unordered list | An array of strings representing the items. | `{ ul: ["item 1", "item 2"] }` |
| `ol` | Ordered list | An array of strings representing the items. | `{ ol: ["item 1", "item 2"] }` |
| `code` | Code block element | An object containing the `language` (`String`) and `content` (`Array` or `String`) fields. | `{ code: { "language": "html", "content": "<script src='dummy.js'></script>" } }` |
| `table` | Table | An object containing the `headers` (`Array` of `String`s) and `rows` (`Array` of `Array`s or `Object`s) and optionally `aligns` (`Array` of `String`s). | `{ table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } }` or `{ table: { headers: ["a", "b"], rows: [["col1", "col2"]] } }` or `{ table: { headers: ["a", "b"], aligns: ["left", "center"], rows: [["col1", "col2"]] } }` |
| `link` | Link | An object containing the `title` and the `source` fields. | `{ title: 'hello', source: 'https://ionicabizau.net' } |
| Type | Element | Data | Example |
|--------------|--------------------|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `h1` | Heading 1 | The heading text as string. | `{ h1: "heading 1" }` |
| `h2` | Heading 2 | The heading text as string. | `{ h2: "heading 2" }` |
| `h3` | Heading 3 | The heading text as string. | `{ h3: "heading 3" }` |
| `h4` | Heading 4 | The heading text as string. | `{ h4: "heading 4" }` |
| `h5` | Heading 5 | The heading text as string. | `{ h5: "heading 5" }` |
| `h6` | Heading 6 | The heading text as string. | `{ h6: "heading 6" }` |
| `p` | Paragraphs | The paragraph text as string or array (multiple paragraphs). | `{ p: "Hello World"}` or multiple paragraphs: `{ p: ["Hello", "World"] }` |
| `blockquote` | Blockquote | The blockquote as string or array (multiple blockquotes) | `{ blockquote: "Hello World"}` or multiple blockquotes: `{ blockquote: ["Hello", "World"] }` |
| `img` | Image | An object or an array of objects containing the `title`, `source` and `alt` fields. | `{ img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } }` |
| `ul` | Unordered list | An array of strings or lists representing the items. | `{ ul: ["item 1", "item 2"] }` |
| `ol` | Ordered list | An array of strings or lists representing the items. | `{ ol: ["item 1", "item 2"] }` |
| `code` | Code block element | An object containing the `language` (`String`) and `content` (`Array` or `String`) fields. | `{ code: { "language": "html", "content": "<script src='dummy.js'></script>" } }` |
| `table` | Table | An object containing the `headers` (`Array` of `String`s) and `rows` (`Array` of `Array`s or `Object`s). | `{ table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } }` or `{ table: { headers: ["a", "b"], rows: [["col1", "col2"]] } }` |
| `link` | Link | An object containing the `title` and the `source` fields. | `{ title: 'hello', source: 'https://ionicabizau.net' }

@@ -290,10 +290,10 @@ You can extend the `json2md.converters` object to support your custom types.

- `@sidneys/releasenotes`
- `@best/github-integration`
- `@microfleet/schema2md`
- `@cypress/schema-tools`
- `@best/github-integration`
- `lambda-docs-2md`
- `jumia-travel-changelog`
- `@cobalt-engine/change-logger`
- `@best/store`
- `uxcore-tools`
- `@best/store`
- `p2doc`

@@ -329,5 +329,9 @@ - `pantheon_site_management`

- `node-red-contrib-json2md`
- `dokuinjs`
- `@feizheng/react-markdown-props`
- `@e2y/bdd-dictionary-generator`
- `@s-ui/changelog`
- `dokuinjs`
- `lab-changelog`
- `dargstack_rgen`
- `@jswork/react-markdown-props`
- `gatsby-source-google-docs`I am using this library to generate documentation for my projects, being integrated with [blah](https://github.com/IonicaBizau/node-blah).

@@ -334,0 +338,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc