ezal-markdown
Advanced tools
Comparing version 0.0.1 to 0.0.3
{ | ||
"name": "ezal-markdown", | ||
"version": "0.0.1", | ||
"version": "0.0.3", | ||
"description": "A simple, asynchronous markdown renderer", | ||
@@ -23,4 +23,3 @@ "main": "scripts/index.js", | ||
}, | ||
"homepage": "https://github.com/JonnyJong/ezal-markdown#readme", | ||
"ezal": "markdown-renderer" | ||
"homepage": "https://github.com/JonnyJong/ezal-markdown#readme" | ||
} |
@@ -0,0 +0,0 @@ [English](./readme.md) |
@@ -0,0 +0,0 @@ [中文](./readme_zh.md) |
@@ -19,12 +19,16 @@ // Type definitions for Ezal Markdown 1.0.0 | ||
options: { | ||
code_highlight?: (src: string, language?: string)=>IAsyncReturnValue<{content: string, language: string}>, | ||
footnote_class?: string, | ||
heading_author_prefix?: string, | ||
todo_list_class?: string, | ||
[x: string | number | symbol]: any, | ||
}, | ||
code_highlight?: ( | ||
src: string, | ||
language?: string | ||
) => IAsyncReturnValue<{ content: string; language: string }>; | ||
footnote_class?: string; | ||
heading_author_prefix?: string; | ||
todo_list_class?: string; | ||
legacy_line_breaks?: boolean; | ||
[x: string | number | symbol]: any; | ||
}; | ||
/** | ||
* 目录 | ||
*/ | ||
toc: IToc, | ||
toc: IToc; | ||
/** | ||
@@ -43,3 +47,3 @@ * 其他由扩展自定义的变量 | ||
*/ | ||
raw: string, | ||
raw: string; | ||
/** | ||
@@ -49,11 +53,11 @@ * 除去格式的文本 | ||
*/ | ||
text: string, | ||
text: string; | ||
/** | ||
* 参数列表 | ||
*/ | ||
args?: string[], | ||
args?: string[]; | ||
/** | ||
* 参数 | ||
*/ | ||
arg?: string, | ||
arg?: string; | ||
/** | ||
@@ -72,3 +76,3 @@ * 其他数据 | ||
*/ | ||
name: string, | ||
name: string; | ||
/** | ||
@@ -79,3 +83,3 @@ * 级别 | ||
*/ | ||
level: 'block' | 'inline', | ||
level: 'block' | 'inline'; | ||
/** | ||
@@ -94,3 +98,6 @@ * 匹配起始位置 | ||
*/ | ||
match(src: string, variables: IVariables): IAsyncReturnValue<IMatched | IEmpty>; | ||
match( | ||
src: string, | ||
variables: IVariables | ||
): IAsyncReturnValue<IMatched | IEmpty>; | ||
/** | ||
@@ -107,3 +114,3 @@ * 渲染匹配的结果 | ||
*/ | ||
priority?: number, | ||
priority?: number; | ||
}; | ||
@@ -118,3 +125,3 @@ /** | ||
*/ | ||
name: string, | ||
name: string; | ||
/** | ||
@@ -125,3 +132,3 @@ * 级别 | ||
*/ | ||
level: 'block' | 'inline', | ||
level: 'block' | 'inline'; | ||
/** | ||
@@ -133,3 +140,3 @@ * 标签闭合 | ||
*/ | ||
end: IEmpty | boolean, | ||
end: IEmpty | boolean; | ||
/** | ||
@@ -141,3 +148,3 @@ * 渲染匹配的结果 | ||
*/ | ||
render(matched: IMatched, variables: IVariables): IAsyncReturnValue<string>, | ||
render(matched: IMatched, variables: IVariables): IAsyncReturnValue<string>; | ||
/** | ||
@@ -147,3 +154,3 @@ * 优先级 | ||
*/ | ||
priority?: number, | ||
priority?: number; | ||
}; | ||
@@ -157,11 +164,11 @@ /** | ||
*/ | ||
name: string, | ||
name: string; | ||
/** | ||
* 锚 | ||
*/ | ||
id: string, | ||
id: string; | ||
/** | ||
* 级别 | ||
*/ | ||
level: number, | ||
level: number; | ||
}; | ||
@@ -175,11 +182,11 @@ /** | ||
*/ | ||
name: string, | ||
name: string; | ||
/** | ||
* 锚 | ||
*/ | ||
id: string, | ||
id: string; | ||
/** | ||
* 子项 | ||
*/ | ||
child: ITreeToc[], | ||
child: ITreeToc[]; | ||
}; | ||
@@ -190,4 +197,4 @@ /** | ||
export type INormalToc = { | ||
flat: IFlatToc[], | ||
tree: ITreeToc[], | ||
flat: IFlatToc[]; | ||
tree: ITreeToc[]; | ||
}; | ||
@@ -210,3 +217,6 @@ /** | ||
*/ | ||
export function IRenderLine(src: string, variables?: IVariables): Promise<{content: string, variables: IVariables}>; | ||
export function IRenderLine( | ||
src: string, | ||
variables?: IVariables | ||
): Promise<{ content: string; variables: IVariables }>; | ||
/** | ||
@@ -218,3 +228,6 @@ * 渲染 Markdown 文本 | ||
*/ | ||
export function IRender(src: string, variables?: IVariables): Promise<{content: string, variables: IVariables, toc: INormalToc}>; | ||
export function IRender( | ||
src: string, | ||
variables?: IVariables | ||
): Promise<{ content: string; variables: IVariables; toc: INormalToc }>; | ||
/** | ||
@@ -221,0 +234,0 @@ * 目录类 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
11563
8
306
1