Skip to content

Commit

Permalink
fix Vanessa219#283
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and stevapple committed Apr 8, 2020
1 parent b2d032f commit ca5d252
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

### v3.1.0 / 2020-04-0x

* [283](https://github.com/Vanessa219/vditor/issues/283) 添加 SetSetext 配置 `引入特性`
* [278](https://github.com/Vanessa219/vditor/issues/278) IR 细节修改 `修复缺陷`

### v3.0.12 / 2020-04-06
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ class Vditor extends VditorMethod {
}

// addScript("src/js/lute/lute.min.js", "vditorLuteScript").then(() => {
// addScript(`http://192.168.2.248:9090/lute.min.js?${new Date().getTime()}`, "vditorLuteScript").then(() => {
addScript(`${mergedOptions.cdn}/dist/js/lute/lute.min.js`, "vditorLuteScript").then(() => {
addScript(`http://192.168.2.248:9090/lute.min.js?${new Date().getTime()}`, "vditorLuteScript").then(() => {
// addScript(`${mergedOptions.cdn}/dist/js/lute/lute.min.js`, "vditorLuteScript").then(() => {
this.vditor.lute = setLute({
autoSpace: this.vditor.options.preview.markdown.autoSpace,
chinesePunct: this.vditor.options.preview.markdown.chinesePunct,
Expand Down
4 changes: 3 additions & 1 deletion src/ts/markdown/previewRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const mergeOptions = (options?: IPreviewOptions) => {
codeBlockPreview: true,
fixTermTypo: false,
footnotes: true,
setext: true,
toc: false,
},
math: {
Expand Down Expand Up @@ -71,7 +72,8 @@ export const md2html = (mdText: string, options?: IPreviewOptions) => {
footnotes: mergedOptions.markdown.footnotes,
headingAnchor: mergedOptions.anchor,
inlineMathDigit: mergedOptions.math.inlineDigit,
toc: mergedOptions.markdown.toc,
setext: mergedOptions.markdown.setext,
toc: mergedOptions.markdown.toc
});
return lute.Md2HTML(mdText);
});
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 @@ -10,5 +10,6 @@ export const setLute = (options: ILuteOptions) => {
lute.SetChinesePunct(options.chinesePunct);
lute.SetFixTermTypo(options.fixTermTypo);
lute.SetVditorCodeBlockPreview(options.codeBlockPreview);
lute.SetSetext(options.setext);
return lute;
};
1 change: 1 addition & 0 deletions src/ts/util/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class Options {
codeBlockPreview: true,
fixTermTypo: false,
footnotes: true,
setext: true,
toc: false,
},
math: {
Expand Down
4 changes: 4 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ interface ILute {

SetEmojiSite(emojiSite: string): void;

SetSetext(enable: boolean): void;

SetVditorCodeBlockPreview(enable: boolean): void;

PutEmojis(emojis: { [key: string]: string }): void;
Expand Down Expand Up @@ -223,6 +225,8 @@ interface IMarkdownConfig {
footnotes?: boolean;
/** wysiwyg & ir 模式代码块是否渲染。默认值: true */
codeBlockPreview: boolean;
/* 是否解析 setext 标题。默认值: true */
setext: boolean;
}

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

0 comments on commit ca5d252

Please sign in to comment.