Skip to content

Commit 1d1dfd9

Browse files
committed
🎨 #1871
1 parent 86c2aaf commit 1d1dfd9

File tree

7 files changed

+10
-0
lines changed

7 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ new Vditor('vditor', {
336336
| mark | 启用 mark 标记 | false |
337337
| sup | 上标 | false |
338338
| sub | 下标 | false |
339+
| imgPathAllowSpace | 图片路径允许空格 | false |
339340

340341
#### options.preview.theme
341342

README_en_US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ new Vditor('vditor', {
320320
| mark | enable mark tag | false |
321321
| sup | superscript | false |
322322
| sub | subscript | false |
323+
| imgPathAllowSpace | Image path allows spaces | false |
323324

324325
#### options.preview.math
325326

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ class Vditor extends VditorMethod {
533533
fixTermTypo: this.vditor.options.preview.markdown.fixTermTypo,
534534
footnotes: this.vditor.options.preview.markdown.footnotes,
535535
headingAnchor: false,
536+
imgPathAllowSpace: this.vditor.options.preview.markdown.imgPathAllowSpace,
536537
inlineMathDigit: this.vditor.options.preview.math.inlineDigit,
537538
linkBase: this.vditor.options.preview.markdown.linkBase,
538539
linkPrefix: this.vditor.options.preview.markdown.linkPrefix,

src/ts/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export abstract class Constants {
5555
codeBlockPreview: true,
5656
fixTermTypo: false,
5757
footnotes: true,
58+
imgPathAllowSpace: false,
5859
linkBase: "",
5960
linkPrefix: "",
6061
listStyle: false,

src/ts/markdown/previewRender.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const md2html = (mdText: string, options?: IPreviewOptions) => {
6666
fixTermTypo: mergedOptions.markdown.fixTermTypo,
6767
footnotes: mergedOptions.markdown.footnotes,
6868
headingAnchor: mergedOptions.anchor !== 0,
69+
imgPathAllowSpace: mergedOptions.markdown.imgPathAllowSpace,
6970
inlineMathDigit: mergedOptions.math.inlineDigit,
7071
lazyLoadImage: mergedOptions.lazyLoadImage,
7172
linkBase: mergedOptions.markdown.linkBase,

src/ts/markdown/setLute.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export const setLute = (options: ILuteOptions) => {
2222
}
2323
lute.SetSup(options.sup);
2424
lute.SetSub(options.sub);
25+
lute.SetImgPathAllowSpace(options.imgPathAllowSpace);
2526
return lute;
2627
};

types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ declare class Lute {
208208

209209
public SetSup(enable: boolean): void;
210210

211+
public SetImgPathAllowSpace(enable: boolean): void;
212+
211213
public PutEmojis(emojis: IObject): void;
212214

213215
public GetEmojis(): IObject;
@@ -530,6 +532,8 @@ interface IMarkdownConfig {
530532
sup?: boolean;
531533
/** 支持下标 */
532534
sub?: boolean;
535+
/** 图片路径允许空格 */
536+
imgPathAllowSpace?: boolean;
533537
}
534538

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

0 commit comments

Comments
 (0)