Skip to content

Commit 03a6aa5

Browse files
committed
output markdown ui is okay
1 parent 7224b97 commit 03a6aa5

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/i18n/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
"settings_commentConvertModeHTMLDesc": "Convert Obsidian notes comments to HTML comments.",
8080
"settings_enableHtml": "Enable HTML",
8181
"settings_enableHtmlDesc": "Enable HTML tags in notes. This might cause XSS attack to your WordPress.",
82+
"settings_uploadRawMarkdown": "Upload Raw Markdown",
83+
"settings_uploadRawMarkdownDesc": "Upload the raw markdown content instead of converting to HTML. This requires your WordPress site to have a markdown parser plugin installed.",
8284
"settings_replaceMediaLinks": "Replace media links",
8385
"settings_replaceMediaLinksDesc": "Replace media links to WordPress URLs after uploading.",
8486
"loginModal_title": "WordPress Login",

src/i18n/zh-cn.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
"settings_commentConvertModeHTMLDesc": "将笔记中的注释转换为 HTML 注释",
8080
"settings_enableHtml": "启用 HTML",
8181
"settings_enableHtmlDesc": "启用笔记中的 HTML 标签。这可能导致针对 WordPress 的 XSS 攻击",
82+
"settings_uploadRawMarkdown": "上传原始 Markdown",
83+
"settings_uploadRawMarkdownDesc": "上传原始 Markdown 内容而不是转换为 HTML。这需要你的 WordPress 站点安装 Markdown 解析插件。",
8284
"settings_replaceMediaLinks": "替换媒体链接",
8385
"settings_replaceMediaLinksDesc": "上传成功之后,将文档中的路径替换为 WordPress 链接",
8486
"loginModal_title": "WordPress 登录",

src/plugin-settings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export interface WordpressPluginSettings {
7070

7171
enableHtml: boolean;
7272

73+
/**
74+
* Whether to upload raw markdown content instead of converting to HTML.
75+
*/
76+
uploadRawMarkdown: boolean;
77+
7378
/**
7479
* Whether media links should be replaced after uploading to WordPress.
7580
*/
@@ -87,6 +92,7 @@ export const DEFAULT_SETTINGS: WordpressPluginSettings = {
8792
mathJaxOutputType: MathJaxOutputType.SVG,
8893
commentConvertMode: CommentConvertMode.Ignore,
8994
enableHtml: false,
95+
uploadRawMarkdown: false,
9096
replaceMediaLinks: true,
9197
}
9298

src/settings.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ export class WordpressSettingTab extends PluginSettingTab {
197197
}),
198198
);
199199

200+
new Setting(containerEl)
201+
.setName(t('settings_uploadRawMarkdown'))
202+
.setDesc(t('settings_uploadRawMarkdownDesc'))
203+
.addToggle((toggle) =>
204+
toggle
205+
.setValue(this.plugin.settings.uploadRawMarkdown)
206+
.onChange(async (value) => {
207+
this.plugin.settings.uploadRawMarkdown = value;
208+
await this.plugin.saveSettings();
209+
}),
210+
);
211+
200212
new Setting(containerEl)
201213
.setName(t('settings_replaceMediaLinks'))
202214
.setDesc(t('settings_replaceMediaLinksDesc'))

0 commit comments

Comments
 (0)