Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ new Vditor('vditor', {
| mark | 启用 mark 标记 | false |
| sup | 上标 | false |
| sub | 下标 | false |
| imgPathAllowSpace | 图片路径允许空格 | false |

#### options.preview.theme

Expand Down
1 change: 1 addition & 0 deletions README_en_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ new Vditor('vditor', {
| mark | enable mark tag | false |
| sup | superscript | false |
| sub | subscript | false |
| imgPathAllowSpace | Image path allows spaces | false |

#### options.preview.math

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ class Vditor extends VditorMethod {
fixTermTypo: this.vditor.options.preview.markdown.fixTermTypo,
footnotes: this.vditor.options.preview.markdown.footnotes,
headingAnchor: false,
imgPathAllowSpace: this.vditor.options.preview.markdown.imgPathAllowSpace,
inlineMathDigit: this.vditor.options.preview.math.inlineDigit,
linkBase: this.vditor.options.preview.markdown.linkBase,
linkPrefix: this.vditor.options.preview.markdown.linkPrefix,
Expand Down
1 change: 1 addition & 0 deletions src/ts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export abstract class Constants {
codeBlockPreview: true,
fixTermTypo: false,
footnotes: true,
imgPathAllowSpace: false,
linkBase: "",
linkPrefix: "",
listStyle: false,
Expand Down
1 change: 1 addition & 0 deletions src/ts/markdown/previewRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const md2html = (mdText: string, options?: IPreviewOptions) => {
fixTermTypo: mergedOptions.markdown.fixTermTypo,
footnotes: mergedOptions.markdown.footnotes,
headingAnchor: mergedOptions.anchor !== 0,
imgPathAllowSpace: mergedOptions.markdown.imgPathAllowSpace,
inlineMathDigit: mergedOptions.math.inlineDigit,
lazyLoadImage: mergedOptions.lazyLoadImage,
linkBase: mergedOptions.markdown.linkBase,
Expand Down
1 change: 1 addition & 0 deletions src/ts/markdown/setLute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ export const setLute = (options: ILuteOptions) => {
}
lute.SetSup(options.sup);
lute.SetSub(options.sub);
lute.SetImgPathAllowSpace(options.imgPathAllowSpace);
return lute;
};
4 changes: 4 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ declare class Lute {

public SetSup(enable: boolean): void;

public SetImgPathAllowSpace(enable: boolean): void;

public PutEmojis(emojis: IObject): void;

public GetEmojis(): IObject;
Expand Down Expand Up @@ -530,6 +532,8 @@ interface IMarkdownConfig {
sup?: boolean;
/** 支持下标 */
sub?: boolean;
/** 图片路径允许空格 */
imgPathAllowSpace?: boolean;
}

/** @link https://ld246.com/article/1549638745630#options-preview */
Expand Down