Skip to content

Commit

Permalink
🎨 fix #431
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed May 24, 2020
1 parent 6205ce4 commit dd7578c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

### v3.2.10 / 2020-05-xx

* [431](https://github.com/Vanessa219/vditor/issues/431) 链接、图片相对路径支持 `引入特性`
* [430](https://github.com/Vanessa219/vditor/issues/430) cursor location when press ctrl+b after checkbox `修复缺陷`
* [429](https://github.com/Vanessa219/vditor/issues/429) localStorage被禁用时,报错 `修复缺陷`
* [427](https://github.com/Vanessa219/vditor/issues/427) headings 大小调整 `改进功能`
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class Vditor extends VditorMethod {
footnotes: this.vditor.options.preview.markdown.footnotes,
headingAnchor: false,
inlineMathDigit: this.vditor.options.preview.math.inlineDigit,
linkBase: this.vditor.options.preview.markdown.linkBase,
listMarker: this.vditor.options.preview.markdown.listMarker,
paragraphBeginningSpace: this.vditor.options.preview.markdown.paragraphBeginningSpace,
sanitize: this.vditor.options.preview.markdown.sanitize,
Expand Down
2 changes: 2 additions & 0 deletions src/ts/markdown/previewRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const mergeOptions = (options?: IPreviewOptions) => {
codeBlockPreview: true,
fixTermTypo: false,
footnotes: true,
linkBase: "",
listMarker: false,
paragraphBeginningSpace: false,
sanitize: true,
Expand Down Expand Up @@ -79,6 +80,7 @@ export const md2html = (mdText: string, options?: IPreviewOptions) => {
headingAnchor: mergedOptions.anchor !== 0,
inlineMathDigit: mergedOptions.math.inlineDigit,
lazyLoadImage: mergedOptions.lazyLoadImage,
linkBase: mergedOptions.markdown.linkBase,
listMarker: mergedOptions.markdown.listMarker,
paragraphBeginningSpace: mergedOptions.markdown.paragraphBeginningSpace,
sanitize: mergedOptions.markdown.sanitize,
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 @@ -14,6 +14,7 @@ export const setLute = (options: ILuteOptions) => {
lute.SetSanitize(options.sanitize);
lute.SetChineseParagraphBeginningSpace(options.paragraphBeginningSpace);
lute.SetRenderListMarker(options.listMarker);
lute.SetLinkBase(options.linkBase);
if (options.lazyLoadImage) {
lute.SetImageLazyLoading(options.lazyLoadImage);
}
Expand Down
1 change: 1 addition & 0 deletions src/ts/util/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class Options {
codeBlockPreview: true,
fixTermTypo: false,
footnotes: true,
linkBase: "",
listMarker: false,
sanitize: true,
setext: false,
Expand Down
4 changes: 4 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ interface ILute {

SetRenderListMarker(enable: boolean): void;

SetLinkBase(url: string): void;

SetSanitize(enable: boolean): void;

SetHeadingAnchor(enable: boolean): void;
Expand Down Expand Up @@ -327,6 +329,8 @@ interface IMarkdownConfig {
sanitize: boolean;
/** 内容主题。默认值:light */
theme?: string;
/** 链接前缀。默认值:'' */
linkBase?: string;
/** 为列表添加标记,以便[自定义列表样式](https://github.com/Vanessa219/vditor/issues/390) 默认值:false */
listMarker?: boolean;
}
Expand Down

0 comments on commit dd7578c

Please sign in to comment.