You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

markdown-it-async

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-async - npm Package Compare versions

Comparing version

to
1.3.0

7

dist/index.d.ts

@@ -15,2 +15,8 @@ import MarkdownIt, { Options, PresetName, PluginSimple as PluginSimple$1, PluginWithOptions as PluginWithOptions$1, PluginWithParams as PluginWithParams$1 } from 'markdown-it';

highlight?: ((str: string, lang: string, attrs: string) => string | Promise<string>) | null | undefined;
/**
* Emit warning when calling `md.render` instead of `md.renderAsync`.
*
* @default false
*/
warnOnSyncRender?: boolean;
}

@@ -31,2 +37,3 @@

use(plugin: PluginWithParams$1, ...params: any[]): this;
render(src: string, env?: any): string;
renderAsync(src: string, env?: any): Promise<string>;

@@ -33,0 +40,0 @@ }

2

package.json
{
"name": "markdown-it-async",
"type": "module",
"version": "1.2.0",
"version": "1.3.0",
"description": "_description_",

@@ -6,0 +6,0 @@ "author": "Anthony Fu <anthonyfu117@hotmail.com>",

@@ -29,2 +29,14 @@ # markdown-it-async

## Opt-in Warning
If you integrate this package into your project, and want to make sure you have every usage of `md.render` migrated to `md.renderAsync`, you can enable the `warnOnSyncRender` option.
```ts
const md = MarkdownItAsync({
warnOnSyncRender: true
})
md.render('Hello') // This will throw a conole warning
```
## How it works?

@@ -31,0 +43,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet