├── settings.gradle ├── assets ├── demo.gif ├── CustomStyle.md └── CustomStyle_ZH.md ├── package.json ├── src └── main │ ├── resources │ ├── vditor │ │ ├── dist │ │ │ ├── ts │ │ │ │ ├── util │ │ │ │ │ ├── merge.d.ts │ │ │ │ │ ├── addStyle.d.ts │ │ │ │ │ ├── code160to32.d.ts │ │ │ │ │ ├── hotKey.d.ts │ │ │ │ │ ├── getSelectText.d.ts │ │ │ │ │ ├── log.d.ts │ │ │ │ │ ├── highlightToolbar.d.ts │ │ │ │ │ ├── addScript.d.ts │ │ │ │ │ ├── hasClosestByHeadings.d.ts │ │ │ │ │ ├── Options.d.ts │ │ │ │ │ ├── processCode.d.ts │ │ │ │ │ ├── toc.d.ts │ │ │ │ │ ├── compatibility.d.ts │ │ │ │ │ ├── RecordMedia.d.ts │ │ │ │ │ ├── selection.d.ts │ │ │ │ │ ├── hasClosest.d.ts │ │ │ │ │ ├── editorCommonEvent.d.ts │ │ │ │ │ └── fixBrowserBehavior.d.ts │ │ │ │ ├── markdown │ │ │ │ │ ├── anchorRender.d.ts │ │ │ │ │ ├── codeRender.d.ts │ │ │ │ │ ├── mediaRender.d.ts │ │ │ │ │ ├── abcRender.d.ts │ │ │ │ │ ├── flowchartRender.d.ts │ │ │ │ │ ├── graphvizRender.d.ts │ │ │ │ │ ├── getHTML.d.ts │ │ │ │ │ ├── markmapRender.d.ts │ │ │ │ │ ├── mermaidRender.d.ts │ │ │ │ │ ├── plantumlRender.d.ts │ │ │ │ │ ├── setLute.d.ts │ │ │ │ │ ├── getMarkdown.d.ts │ │ │ │ │ ├── chartRender.d.ts │ │ │ │ │ ├── mindmapRender.d.ts │ │ │ │ │ ├── highlightRender.d.ts │ │ │ │ │ ├── outlineRender.d.ts │ │ │ │ │ ├── lazyLoadImageRender.d.ts │ │ │ │ │ ├── speechRender.d.ts │ │ │ │ │ ├── mathRender.d.ts │ │ │ │ │ ├── previewRender.d.ts │ │ │ │ │ └── adapterRender.d.ts │ │ │ │ ├── toolbar │ │ │ │ │ ├── Br.d.ts │ │ │ │ │ ├── Divider.d.ts │ │ │ │ │ ├── MenuItem.d.ts │ │ │ │ │ ├── Both.d.ts │ │ │ │ │ ├── Help.d.ts │ │ │ │ │ ├── Info.d.ts │ │ │ │ │ ├── Redo.d.ts │ │ │ │ │ ├── Undo.d.ts │ │ │ │ │ ├── Custom.d.ts │ │ │ │ │ ├── Indent.d.ts │ │ │ │ │ ├── Outdent.d.ts │ │ │ │ │ ├── Outline.d.ts │ │ │ │ │ ├── Counter.d.ts │ │ │ │ │ ├── Devtools.d.ts │ │ │ │ │ ├── InsertAfter.d.ts │ │ │ │ │ ├── InsertBefore.d.ts │ │ │ │ │ ├── Export.d.ts │ │ │ │ │ ├── CodeTheme.d.ts │ │ │ │ │ ├── ContentTheme.d.ts │ │ │ │ │ ├── Record.d.ts │ │ │ │ │ ├── Upload.d.ts │ │ │ │ │ ├── Preview.d.ts │ │ │ │ │ ├── Emoji.d.ts │ │ │ │ │ ├── index.d.ts │ │ │ │ │ ├── Fullscreen.d.ts │ │ │ │ │ ├── Headings.d.ts │ │ │ │ │ ├── EditMode.d.ts │ │ │ │ │ └── setToolbar.d.ts │ │ │ │ ├── ui │ │ │ │ │ ├── setCodeTheme.d.ts │ │ │ │ │ ├── setContentTheme.d.ts │ │ │ │ │ ├── setTheme.d.ts │ │ │ │ │ ├── setPreviewMode.d.ts │ │ │ │ │ └── initUI.d.ts │ │ │ │ ├── upload │ │ │ │ │ ├── getElement.d.ts │ │ │ │ │ ├── setHeaders.d.ts │ │ │ │ │ └── index.d.ts │ │ │ │ ├── ir │ │ │ │ │ ├── expandMarker.d.ts │ │ │ │ │ ├── highlightToolbarIR.d.ts │ │ │ │ │ ├── processKeydown.d.ts │ │ │ │ │ ├── input.d.ts │ │ │ │ │ ├── index.d.ts │ │ │ │ │ └── process.d.ts │ │ │ │ ├── sv │ │ │ │ │ ├── inputEvent.d.ts │ │ │ │ │ ├── processKeydown.d.ts │ │ │ │ │ ├── combineFootnote.d.ts │ │ │ │ │ ├── index.d.ts │ │ │ │ │ └── process.d.ts │ │ │ │ ├── wysiwyg │ │ │ │ │ ├── input.d.ts │ │ │ │ │ ├── toolbarEvent.d.ts │ │ │ │ │ ├── showCode.d.ts │ │ │ │ │ ├── setHeading.d.ts │ │ │ │ │ ├── afterRenderEvent.d.ts │ │ │ │ │ ├── processKeydown.d.ts │ │ │ │ │ ├── renderDomByMd.d.ts │ │ │ │ │ ├── highlightToolbarWYSIWYG.d.ts │ │ │ │ │ ├── inlineTag.d.ts │ │ │ │ │ └── index.d.ts │ │ │ │ ├── preview │ │ │ │ │ ├── image.d.ts │ │ │ │ │ └── index.d.ts │ │ │ │ ├── tip │ │ │ │ │ └── index.d.ts │ │ │ │ ├── resize │ │ │ │ │ └── index.d.ts │ │ │ │ ├── devtools │ │ │ │ │ └── index.d.ts │ │ │ │ ├── outline │ │ │ │ │ └── index.d.ts │ │ │ │ ├── export │ │ │ │ │ └── index.d.ts │ │ │ │ ├── hint │ │ │ │ │ └── index.d.ts │ │ │ │ ├── undo │ │ │ │ │ └── index.d.ts │ │ │ │ └── constants.d.ts │ │ │ ├── images │ │ │ │ ├── logo.png │ │ │ │ └── img-loading.svg │ │ │ ├── js │ │ │ │ ├── katex │ │ │ │ │ └── fonts │ │ │ │ │ │ ├── KaTeX_Main-Bold.ttf │ │ │ │ │ │ ├── KaTeX_Main-Bold.woff │ │ │ │ │ │ ├── KaTeX_AMS-Regular.ttf │ │ │ │ │ │ ├── KaTeX_AMS-Regular.woff │ │ │ │ │ │ ├── KaTeX_AMS-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ │ │ │ │ ├── KaTeX_Fraktur-Bold.woff │ │ │ │ │ │ ├── KaTeX_Main-Bold.woff2 │ │ │ │ │ │ ├── KaTeX_Main-Italic.ttf │ │ │ │ │ │ ├── KaTeX_Main-Italic.woff │ │ │ │ │ │ ├── KaTeX_Main-Italic.woff2 │ │ │ │ │ │ ├── KaTeX_Main-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Main-Regular.woff │ │ │ │ │ │ ├── KaTeX_Math-Italic.ttf │ │ │ │ │ │ ├── KaTeX_Math-Italic.woff │ │ │ │ │ │ ├── KaTeX_Math-Italic.woff2 │ │ │ │ │ │ ├── KaTeX_Size1-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Size2-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Size3-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Size4-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ │ │ │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ │ │ │ │ ├── KaTeX_Main-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ │ │ │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ │ │ │ │ ├── KaTeX_SansSerif-Bold.woff │ │ │ │ │ │ ├── KaTeX_Script-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Script-Regular.woff │ │ │ │ │ │ ├── KaTeX_Size1-Regular.woff │ │ │ │ │ │ ├── KaTeX_Size1-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Size2-Regular.woff │ │ │ │ │ │ ├── KaTeX_Size2-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Size3-Regular.woff │ │ │ │ │ │ ├── KaTeX_Size3-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Size4-Regular.woff │ │ │ │ │ │ ├── KaTeX_Size4-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ │ │ │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ │ │ │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ │ │ │ │ ├── KaTeX_Fraktur-Regular.woff │ │ │ │ │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Main-BoldItalic.woff │ │ │ │ │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ │ │ │ │ ├── KaTeX_Math-BoldItalic.woff │ │ │ │ │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ │ │ │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ │ │ │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ │ │ │ │ ├── KaTeX_SansSerif-Italic.woff │ │ │ │ │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ │ │ │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ │ │ │ │ ├── KaTeX_SansSerif-Regular.woff │ │ │ │ │ │ ├── KaTeX_Script-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ │ │ │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ │ │ │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ │ │ │ │ ├── KaTeX_Typewriter-Regular.woff │ │ │ │ │ │ ├── KaTeX_Typewriter-Regular.woff2 │ │ │ │ │ │ └── KaTeX_Caligraphic-Regular.woff2 │ │ │ │ ├── mathjax │ │ │ │ │ ├── sre │ │ │ │ │ │ └── sre-node.js │ │ │ │ │ └── input │ │ │ │ │ │ └── tex │ │ │ │ │ │ └── extensions │ │ │ │ │ │ ├── noerrors.js │ │ │ │ │ │ ├── noundefined.js │ │ │ │ │ │ ├── enclose.js │ │ │ │ │ │ ├── colorV2.js │ │ │ │ │ │ ├── verb.js │ │ │ │ │ │ ├── action.js │ │ │ │ │ │ ├── html.js │ │ │ │ │ │ └── bbox.js │ │ │ │ ├── i18n │ │ │ │ │ ├── zh_TW.js │ │ │ │ │ ├── zh_CN.js │ │ │ │ │ ├── ko_KR.js │ │ │ │ │ ├── ja_JP.js │ │ │ │ │ ├── en_US.js │ │ │ │ │ ├── sv_SE.js │ │ │ │ │ ├── pt_BR.js │ │ │ │ │ ├── fr_FR.js │ │ │ │ │ └── ru_RU.js │ │ │ │ ├── highlight.js │ │ │ │ │ └── yul.min.js │ │ │ │ └── markmap │ │ │ │ │ └── prism.css │ │ │ ├── index.d.ts │ │ │ ├── method.d.ts │ │ │ └── css │ │ │ │ └── content-theme │ │ │ │ ├── light.css │ │ │ │ ├── idea-light.css │ │ │ │ ├── wechat.css │ │ │ │ └── dark.css │ │ └── fonts │ │ │ ├── JetBrainsMono-Bold.woff2 │ │ │ ├── JetBrainsMono-Thin.woff2 │ │ │ ├── JetBrainsMono-Italic.woff2 │ │ │ ├── JetBrainsMono-Light.woff2 │ │ │ ├── JetBrainsMono-Medium.woff2 │ │ │ ├── JetBrainsMono-Regular.woff2 │ │ │ ├── JetBrainsMono-ExtraBold.woff2 │ │ │ ├── JetBrainsMono-SemiBold.woff2 │ │ │ ├── JetBrainsMono-BoldItalic.woff2 │ │ │ ├── JetBrainsMono-ExtraLight.woff2 │ │ │ ├── JetBrainsMono-LightItalic.woff2 │ │ │ ├── JetBrainsMono-MediumItalic.woff2 │ │ │ ├── JetBrainsMono-ThinItalic.woff2 │ │ │ ├── JetBrainsMono-SemiBoldItalic.woff2 │ │ │ ├── JetBrainsMono-ExtraBoldItalic.woff2 │ │ │ └── JetBrainsMono-ExtraLightItalic.woff2 │ ├── i18n │ │ ├── info.properties │ │ └── info_zh.properties │ └── META-INF │ │ └── pluginIcon.svg │ └── java │ └── com │ └── shuzijun │ └── markdown │ ├── editor │ ├── MarkdownLanguage.java │ ├── SearchAction.java │ ├── SearchVisibleAction.java │ ├── MarkdownFileType.java │ ├── DevtoolsAction.java │ ├── MarkdownPreviewFileEditorProvider.java │ └── ProxyLoadHtmlResourceHandler.java │ ├── util │ ├── PropertiesUtils.java │ ├── FileUtils.java │ └── SentryUtils.java │ ├── controller │ ├── FileApplicationService.java │ ├── ResourcesController.java │ ├── AssetsController.java │ └── PreviewStaticServer.java │ ├── listener │ ├── SupportCheck.java │ └── ErrorReportHandler.java │ ├── ui │ ├── OverwriteDialogWrapper.java │ ├── ExportFileDialogWrapper.form │ ├── ExportFileDialogWrapper.java │ ├── UploadFileDialogWrapper.form │ └── PdfDialogWrapper.java │ ├── model │ ├── MarkdownResponse.java │ ├── PluginConstant.java │ └── UploadResponse.java │ └── setting │ └── SettingConfigurable.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── .github ├── dependabot.yml ├── FUNDING.yml └── workflows │ ├── dependencies.yml │ ├── SyncTemplate.yml │ └── Release.yml ├── README_ZH.md ├── README.md ├── CHANGELOG.md ├── gradlew.bat └── .gitignore /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'markdown-editor' 2 | 3 | -------------------------------------------------------------------------------- /assets/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/assets/demo.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1, 3 | "dependencies": { 4 | "vditor": "3.9.9" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/merge.d.ts: -------------------------------------------------------------------------------- 1 | export declare const merge: (...options: any[]) => any; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/anchorRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const anchorRender: (type: number) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/addStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const addStyle: (url: string, id: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/code160to32.d.ts: -------------------------------------------------------------------------------- 1 | export declare const code160to32: (text: string) => string; 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/codeRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const codeRender: (element: HTMLElement) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/mediaRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mediaRender: (element: HTMLElement) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Br.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Br { 2 | element: HTMLElement; 3 | constructor(); 4 | } 5 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ui/setCodeTheme.d.ts: -------------------------------------------------------------------------------- 1 | export declare const setCodeTheme: (codeTheme: string, cdn?: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/hotKey.d.ts: -------------------------------------------------------------------------------- 1 | export declare const matchHotKey: (hotKey: string, event: KeyboardEvent) => boolean; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Divider.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Divider { 2 | element: HTMLElement; 3 | constructor(); 4 | } 5 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ui/setContentTheme.d.ts: -------------------------------------------------------------------------------- 1 | export declare const setContentTheme: (contentTheme: string, path: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/getSelectText.d.ts: -------------------------------------------------------------------------------- 1 | export declare const getSelectText: (editor: HTMLElement, range?: Range) => string; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/images/logo.png -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/abcRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const abcRender: (element?: (HTMLElement | Document), cdn?: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/flowchartRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const flowchartRender: (element: HTMLElement, cdn?: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/graphvizRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const graphvizRender: (element: HTMLElement, cdn?: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ui/setTheme.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const setTheme: (vditor: IVditor) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/log.d.ts: -------------------------------------------------------------------------------- 1 | export declare const log: (method: string, content: string, type: string, print: boolean) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/getHTML.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const getHTML: (vditor: IVditor) => string; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/markmapRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const markmapRender: (element: HTMLElement, cdn: string, theme: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/mermaidRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mermaidRender: (element: HTMLElement, cdn: string, theme: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/plantumlRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const plantumlRender: (element?: (HTMLElement | Document), cdn?: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/setLute.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const setLute: (options: ILuteOptions) => Lute; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/getMarkdown.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const getMarkdown: (vditor: IVditor) => string; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/upload/getElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const getElement: (vditor: IVditor) => HTMLPreElement; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/highlightToolbar.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const highlightToolbar: (vditor: IVditor) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ir/expandMarker.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const expandMarker: (range: Range, vditor: IVditor) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ir/highlightToolbarIR.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const highlightToolbarIR: (vditor: IVditor) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/chartRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const chartRender: (element: (HTMLElement | Document), cdn: string, theme: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-Bold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-Thin.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/mindmapRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mindmapRender: (element: (HTMLElement | Document), cdn: string, theme: string) => void; 2 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/sv/inputEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const inputEvent: (vditor: IVditor, event?: InputEvent) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-Italic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-Light.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-Medium.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/upload/setHeaders.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const setHeaders: (vditor: IVditor, xhr: XMLHttpRequest) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/input.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const input: (vditor: IVditor, range: Range, event?: InputEvent) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-ExtraBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-ExtraBold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-SemiBold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ir/processKeydown.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const processKeydown: (vditor: IVditor, event: KeyboardEvent) => boolean; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/sv/processKeydown.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const processKeydown: (vditor: IVditor, event: KeyboardEvent) => boolean; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ui/setPreviewMode.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const setPreviewMode: (mode: "both" | "editor", vditor: IVditor) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-BoldItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-ExtraLight.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-ExtraLight.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-LightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-LightItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-MediumItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-MediumItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-ThinItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-ThinItalic.woff2 -------------------------------------------------------------------------------- /assets/CustomStyle.md: -------------------------------------------------------------------------------- 1 | # Custom Style 2 | 3 | * [English Document](#TODO) 4 | 5 | - [中文文档](https://github.com/shuzijun/markdown-editor/blob/main/assets/CustomStyle_ZH.md) 6 | 7 | # TODO 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-SemiBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-SemiBoldItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/toolbarEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const toolbarEvent: (vditor: IVditor, actionBtn: Element, event: Event) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-ExtraBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-ExtraBoldItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/fonts/JetBrainsMono-ExtraLightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/fonts/JetBrainsMono-ExtraLightItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ir/input.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const input: (vditor: IVditor, range: Range, ignoreSpace?: boolean, event?: InputEvent) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/showCode.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const showCode: (previewElement: HTMLElement, vditor: IVditor, first?: boolean) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/preview/image.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const previewImage: (oldImgElement: HTMLImageElement, lang?: keyof II18n, theme?: string) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/tip/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Tip { 2 | element: HTMLElement; 3 | constructor(); 4 | show(text: string, time?: number): void; 5 | hide(): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuzijun/markdown-editor/HEAD/src/main/resources/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/addScript.d.ts: -------------------------------------------------------------------------------- 1 | export declare const addScriptSync: (path: string, id: string) => boolean; 2 | export declare const addScript: (path: string, id: string) => Promise; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/highlightRender.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const highlightRender: (hljsOption?: IHljs, element?: HTMLElement | Document, cdn?: string) => void; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/outlineRender.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const outlineRender: (contentElement: HTMLElement, targetElement: Element, vditor?: IVditor) => string; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/resize/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Resize { 3 | element: HTMLElement; 4 | constructor(vditor: IVditor); 5 | private bindEvent; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/MenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class MenuItem { 3 | element: HTMLElement; 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/setHeading.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const setHeading: (vditor: IVditor, tagName: string) => void; 3 | export declare const removeHeading: (vditor: IVditor) => void; 4 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Both.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Both extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Help.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Help extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Info.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Info extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Redo.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Redo extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Undo.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Undo extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Custom.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Custom extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Indent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Indent extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Outdent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Outdent extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Outline.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Outline extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/hasClosestByHeadings.d.ts: -------------------------------------------------------------------------------- 1 | export declare const hasClosestByTag: (element: Node, nodeName: string) => false | HTMLElement; 2 | export declare const hasClosestByHeadings: (element: Node) => false | HTMLElement; 3 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Counter.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Counter { 3 | element: HTMLElement; 4 | constructor(vditor: IVditor); 5 | render(vditor: IVditor, mdText: string): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Devtools.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Devtools extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/devtools/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class DevTools { 3 | element: HTMLDivElement; 4 | private ASTChart; 5 | constructor(); 6 | renderEchart(vditor: IVditor): void; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/InsertAfter.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class InsertAfter extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/InsertBefore.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class InsertBefore extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Export.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Export extends MenuItem { 4 | element: HTMLElement; 5 | constructor(vditor: IVditor, menuItem: IMenuItem); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/CodeTheme.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class CodeTheme extends MenuItem { 4 | element: HTMLElement; 5 | constructor(vditor: IVditor, menuItem: IMenuItem); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/Options.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Options { 3 | options: IOptions; 4 | private defaultOptions; 5 | constructor(options: IOptions); 6 | merge(): IOptions; 7 | private mergeToolbar; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/afterRenderEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const afterRenderEvent: (vditor: IVditor, options?: { 3 | enableAddUndoStack: boolean; 4 | enableHint: boolean; 5 | enableInput: boolean; 6 | }) => void; 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/lazyLoadImageRender.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | vditorImageIntersectionObserver: IntersectionObserver; 4 | } 5 | } 6 | export declare const lazyLoadImageRender: (element?: (HTMLElement | Document)) => boolean; 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/speechRender.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare global { 3 | interface Window { 4 | vditorSpeechRange: Range; 5 | } 6 | } 7 | export declare const speechRender: (element: HTMLElement, lang?: keyof II18n) => void; 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/ContentTheme.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class ContentTheme extends MenuItem { 4 | element: HTMLElement; 5 | constructor(vditor: IVditor, menuItem: IMenuItem); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Record.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Record extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | _bindEvent(vditor: IVditor): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Upload.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Upload extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | _bindEvent(vditor: IVditor): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/processKeydown.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const processKeydown: (vditor: IVditor, event: KeyboardEvent) => boolean; 3 | export declare const removeBlockElement: (vditor: IVditor, event: KeyboardEvent) => boolean; 4 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/renderDomByMd.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const renderDomByMd: (vditor: IVditor, md: string, options?: { 3 | enableAddUndoStack: boolean; 4 | enableHint: boolean; 5 | enableInput: boolean; 6 | }) => void; 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Preview.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Preview extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | _bindEvent(vditor: IVditor): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/processCode.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const processPasteCode: (html: string, text: string, type?: string) => string | false; 3 | export declare const processCodeRender: (previewPanel: HTMLElement, vditor: IVditor) => void; 4 | -------------------------------------------------------------------------------- /src/main/resources/i18n/info.properties: -------------------------------------------------------------------------------- 1 | Lang=en_US 2 | report=Report to plugin developer 3 | overwrite.file=The file already exists. 4 | overwrite.img=If the overwritten file is an image and the image is being displayed in the editor, please reopen the editor to update and display the latest image. 5 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/sv/combineFootnote.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 合并脚注 3 | * @param elements vditor.sv.element 4 | * @param afterCombine 每个脚注块合并完成后的回调, param: root为合并后的脚注块 5 | */ 6 | export declare const combineFootnote: (elements: HTMLElement, afterCombine?: (root: HTMLElement) => void) => void; 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Emoji.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Emoji extends MenuItem { 4 | element: HTMLElement; 5 | constructor(vditor: IVditor, menuItem: IMenuItem); 6 | private bindEvent; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Toolbar { 3 | elements: { 4 | [key: string]: HTMLElement; 5 | }; 6 | element: HTMLElement; 7 | constructor(vditor: IVditor); 8 | private genItem; 9 | } 10 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | pluginGroup = com.shuzijun.markdown 2 | pluginName = markdown-editor 3 | pluginVersion = 2.0.5 4 | 5 | pluginSinceBuild = 221.0 6 | pluginUntilBuild = 7 | 8 | platformType = IU 9 | platformVersion = 2022.1 10 | 11 | runIdeJvmArgs=-Dfile.encoding=utf-8,-Dide.browser.jcef.log.level=verbose -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/outline/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Outline { 3 | element: HTMLElement; 4 | constructor(outlineLabel: string); 5 | render(vditor: IVditor): string; 6 | toggle(vditor: IVditor, show?: boolean, focus?: boolean): void; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Fullscreen.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Fullscreen extends MenuItem { 4 | constructor(vditor: IVditor, menuItem: IMenuItem); 5 | _bindEvent(vditor: IVditor, menuItem: IMenuItem): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/mathRender.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare global { 3 | interface Window { 4 | MathJax: any; 5 | } 6 | } 7 | export declare const mathRender: (element: HTMLElement, options?: { 8 | cdn?: string; 9 | math?: IMath; 10 | }) => void; 11 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/previewRender.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const md2html: (mdText: string, options?: IPreviewOptions) => Promise; 3 | export declare const previewRender: (previewElement: HTMLDivElement, markdown: string, options?: IPreviewOptions) => Promise; 4 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/Headings.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare class Headings extends MenuItem { 4 | element: HTMLElement; 5 | constructor(vditor: IVditor, menuItem: IMenuItem); 6 | _bindEvent(vditor: IVditor, panelElement: HTMLElement): void; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/export/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const download: (vditor: IVditor, content: string, filename: string) => void; 3 | export declare const exportMarkdown: (vditor: IVditor) => void; 4 | export declare const exportPDF: (vditor: IVditor) => void; 5 | export declare const exportHTML: (vditor: IVditor) => void; 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/preview/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Preview { 3 | element: HTMLElement; 4 | previewElement: HTMLElement; 5 | private mdTimeoutId; 6 | constructor(vditor: IVditor); 7 | render(vditor: IVditor, value?: string): void; 8 | private afterRender; 9 | private copyToX; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/toc.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const renderToc: (vditor: IVditor) => void; 3 | export declare const clickToc: (event: MouseEvent & { 4 | target: HTMLElement; 5 | }, vditor: IVditor) => void; 6 | export declare const keydownToc: (blockElement: HTMLElement, vditor: IVditor, event: KeyboardEvent, range: Range) => boolean; 7 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/sre/sre-node.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var SRE = require("speech-rule-engine"); 4 | global.SRE = SRE; 5 | global.sre = Object.create(SRE); 6 | global.sre.Engine = { 7 | isReady: function () { 8 | return SRE.engineReady(); 9 | } 10 | }; 11 | //# sourceMappingURL=sre-node.js.map -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/upload/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare class Upload { 3 | element: HTMLElement; 4 | isUploading: boolean; 5 | range: Range; 6 | constructor(); 7 | } 8 | declare const uploadFiles: (vditor: IVditor, files: FileList | DataTransferItemList | File[], element?: HTMLInputElement) => Promise; 9 | export { Upload, uploadFiles }; 10 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ir/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare class IR { 3 | range: Range; 4 | element: HTMLPreElement; 5 | processTimeoutId: number; 6 | hlToolbarTimeoutId: number; 7 | composingLock: boolean; 8 | preventInput: boolean; 9 | constructor(vditor: IVditor); 10 | private copy; 11 | private bindEvent; 12 | } 13 | export { IR }; 14 | -------------------------------------------------------------------------------- /src/main/resources/i18n/info_zh.properties: -------------------------------------------------------------------------------- 1 | Lang=zh_CN 2 | report=\u5411\u63D2\u4EF6\u4F5C\u8005\u62A5\u544A 3 | overwrite.file=\u6587\u4EF6\u5DF2\u7ECF\u5B58\u5728. 4 | overwrite.img=\u5982\u679C\u8986\u76D6\u7684\u6587\u4EF6\u4E3A\u56FE\u7247.\u4E14\u8BE5\u56FE\u7247\u5728\u7F16\u8F91\u5668\u4E2D\u6B63\u5728\u5C55\u793A,\u8BF7\u91CD\u65B0\u6253\u5F00\u7F16\u8F91\u5668,\u4EE5\u66F4\u65B0\u5C55\u793A\u6700\u65B0\u56FE\u7247. -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/MarkdownLanguage.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.shuzijun.markdown.editor; 3 | 4 | import com.intellij.lang.Language; 5 | 6 | public class MarkdownLanguage extends Language { 7 | 8 | public static final MarkdownLanguage INSTANCE = new MarkdownLanguage(); 9 | 10 | protected MarkdownLanguage() { 11 | super("Markdown Editor", "text/x-markdown"); 12 | } 13 | }*/ 14 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/sv/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare class Editor { 3 | range: Range; 4 | element: HTMLPreElement; 5 | composingLock: boolean; 6 | processTimeoutId: number; 7 | hlToolbarTimeoutId: number; 8 | preventInput: boolean; 9 | constructor(vditor: IVditor); 10 | private copy; 11 | private bindEvent; 12 | } 13 | export { Editor }; 14 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ui/initUI.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare global { 3 | interface Window { 4 | visualViewport: HTMLElement; 5 | } 6 | } 7 | export declare const initUI: (vditor: IVditor) => void; 8 | export declare const setPadding: (vditor: IVditor) => void; 9 | export declare const setTypewriterPosition: (vditor: IVditor) => void; 10 | export declare function UIUnbindListener(): void; 11 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/EditMode.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItem } from "./MenuItem"; 3 | export declare const setEditMode: (vditor: IVditor, type: string, event: Event | string) => void; 4 | export declare class EditMode extends MenuItem { 5 | element: HTMLElement; 6 | constructor(vditor: IVditor, menuItem: IMenuItem); 7 | _bindEvent(vditor: IVditor, panelElement: HTMLElement, menuItem: IMenuItem): void; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/compatibility.d.ts: -------------------------------------------------------------------------------- 1 | export declare const isSafari: () => boolean; 2 | export declare const isFirefox: () => boolean; 3 | export declare const accessLocalStorage: () => boolean; 4 | export declare const getEventName: () => "click" | "touchstart"; 5 | export declare const isCtrl: (event: KeyboardEvent) => boolean; 6 | export declare const updateHotkeyTip: (hotkey: string) => string; 7 | export declare const isChrome: () => boolean; 8 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/highlightToolbarWYSIWYG.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const highlightToolbarWYSIWYG: (vditor: IVditor) => void; 3 | export declare const genLinkRefPopover: (vditor: IVditor, linkRefElement: HTMLElement, range?: Range) => void; 4 | export declare const genAPopover: (vditor: IVditor, aElement: HTMLElement, range: Range) => void; 5 | export declare const genImagePopover: (event: Event, vditor: IVditor) => void; 6 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/ir/process.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const processHint: (vditor: IVditor) => void; 3 | export declare const processAfterRender: (vditor: IVditor, options?: { 4 | enableAddUndoStack: boolean; 5 | enableHint: boolean; 6 | enableInput: boolean; 7 | }) => void; 8 | export declare const processHeading: (vditor: IVditor, value: string) => void; 9 | export declare const processToolbar: (vditor: IVditor, actionBtn: Element, prefix: string, suffix: string) => void; 10 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/util/PropertiesUtils.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.util; 2 | 3 | import java.text.MessageFormat; 4 | import java.util.ResourceBundle; 5 | 6 | /** 7 | * @author shuzijun 8 | */ 9 | public class PropertiesUtils { 10 | 11 | private final static String baseName = "i18n/info"; 12 | private final static ResourceBundle rb1 = ResourceBundle.getBundle(baseName); 13 | 14 | public static String getInfo(String key, String... params) { 15 | return new MessageFormat(rb1.getString(key)).format(params); 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/hint/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare class Hint { 3 | timeId: number; 4 | element: HTMLDivElement; 5 | recentLanguage: string; 6 | private splitChar; 7 | private lastIndex; 8 | constructor(hintExtends: IHintExtend[]); 9 | render(vditor: IVditor): void; 10 | genHTML(data: IHintData[], key: string, vditor: IVditor): void; 11 | fillEmoji: (element: HTMLElement, vditor: IVditor) => void; 12 | select(event: KeyboardEvent, vditor: IVditor): boolean; 13 | private getKey; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/undo/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare class Undo { 3 | private stackSize; 4 | private dmp; 5 | private wysiwyg; 6 | private ir; 7 | private sv; 8 | constructor(); 9 | clearStack(vditor: IVditor): void; 10 | resetIcon(vditor: IVditor): void; 11 | undo(vditor: IVditor): void; 12 | redo(vditor: IVditor): void; 13 | recordFirstPosition(vditor: IVditor, event: KeyboardEvent): void; 14 | addToUndoStack(vditor: IVditor): void; 15 | private renderDiff; 16 | private resetStack; 17 | private addCaret; 18 | } 19 | export { Undo }; 20 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/inlineTag.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const previoueIsEmptyA: (node: Node) => false | HTMLElement; 3 | export declare const nextIsCode: (range: Range) => boolean; 4 | export declare const getNextHTML: (node: Node) => string; 5 | export declare const getPreviousHTML: (node: Node) => string; 6 | export declare const getRenderElementNextNode: (blockCodeElement: HTMLElement) => ChildNode; 7 | export declare const splitElement: (range: Range) => { 8 | afterHTML: string; 9 | beforeHTML: string; 10 | }; 11 | export declare const modifyPre: (vditor: IVditor, range: Range) => void; 12 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/RecordMedia.d.ts: -------------------------------------------------------------------------------- 1 | export declare class RecordMedia { 2 | SAMPLE_RATE: number; 3 | DEFAULT_SAMPLE_RATE: number; 4 | isRecording: boolean; 5 | readyFlag: boolean; 6 | leftChannel: Float32List[]; 7 | rightChannel: Float32List[]; 8 | recordingLength: number; 9 | recorder: ScriptProcessorNode; 10 | constructor(e: MediaStream); 11 | cloneChannelData(leftChannelData: Float32List, rightChannelData: Float32List): void; 12 | startRecordingNewWavFile(): void; 13 | stopRecording(): void; 14 | buildWavFileBlob(): Blob; 15 | private downSampleBuffer; 16 | private mergeBuffers; 17 | private writeUTFBytes; 18 | } 19 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://shuzijun.cn/donate.html'] 13 | -------------------------------------------------------------------------------- /README_ZH.md: -------------------------------------------------------------------------------- 1 | # markdown-editor 2 | 3 | IntelliJ平台一个功能齐全的所见即所得Markdown编辑器 4 | 5 | - [English Document](https://github.com/shuzijun/markdown-editor/blob/main/README.md) 6 | - [中文文档](#功能) 7 | - 有用的链接 8 | - [自定义样式](https://github.com/shuzijun/markdown-editor/blob/main/assets/CustomStyle_ZH.md) 9 | 10 | # 功能 11 | 12 | * 支持三种编辑模式:所见即所得、即时渲染、分屏预览 13 | * 支持大纲、数学公式、脑图、图表、流程图、甘特图、时序图、五线谱、标题锚点、代码高亮、graphviz 渲染、plantuml 14 | * 支持图片粘贴,文件上传或拖入快速插入 15 | * 支持使用IDE快速打开文件 16 | * 更多功能参考 [vditor features](https://github.com/Vanessa219/vditor/blob/master/README_en_US.md#--features) 17 | 18 | # 演示 19 | 20 | ![demo.gif](https://raw.githubusercontent.com/shuzijun/markdown-editor/main/assets/demo.gif) 21 | 22 | # 感谢 23 | 24 | * [vditor](https://github.com/Vanessa219/vditor) 25 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/wysiwyg/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare class WYSIWYG { 3 | range: Range; 4 | element: HTMLPreElement; 5 | popover: HTMLDivElement; 6 | selectPopover: HTMLDivElement; 7 | afterRenderTimeoutId: number; 8 | hlToolbarTimeoutId: number; 9 | preventInput: boolean; 10 | composingLock: boolean; 11 | commentIds: string[]; 12 | private scrollListener; 13 | constructor(vditor: IVditor); 14 | getComments(vditor: IVditor, getData?: boolean): ICommentsData[]; 15 | triggerRemoveComment(vditor: IVditor): void; 16 | showComment(): void; 17 | hideComment(): void; 18 | unbindListener(): void; 19 | private copy; 20 | private bindEvent; 21 | } 22 | export { WYSIWYG }; 23 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/SearchAction.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.editor; 2 | 3 | import com.intellij.openapi.actionSystem.AnAction; 4 | import com.intellij.openapi.actionSystem.AnActionEvent; 5 | import com.intellij.openapi.fileEditor.FileEditorManager; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | /** 9 | * @author shuzijun 10 | */ 11 | public class SearchAction extends AnAction { 12 | @Override 13 | public void actionPerformed(@NotNull AnActionEvent e) { 14 | try { 15 | MarkdownPreviewFileEditor fileEditor = (MarkdownPreviewFileEditor) FileEditorManager.getInstance(e.getProject()).getSelectedEditor(); 16 | fileEditor.visibleToolbarPanel(true); 17 | }catch (Exception ignore){ 18 | 19 | } 20 | 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/SearchVisibleAction.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.editor; 2 | 3 | import com.intellij.openapi.actionSystem.AnAction; 4 | import com.intellij.openapi.actionSystem.AnActionEvent; 5 | import com.intellij.openapi.fileEditor.FileEditorManager; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | /** 9 | * @author shuzijun 10 | */ 11 | public class SearchVisibleAction extends AnAction { 12 | @Override 13 | public void actionPerformed(@NotNull AnActionEvent e) { 14 | try { 15 | MarkdownPreviewFileEditor fileEditor = (MarkdownPreviewFileEditor) FileEditorManager.getInstance(e.getProject()).getSelectedEditor(); 16 | fileEditor.visibleToolbarPanel(false); 17 | }catch (Exception ignore){ 18 | 19 | } 20 | 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/sv/process.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const processPaste: (vditor: IVditor, text: string) => void; 3 | export declare const getSideByType: (spanNode: Node, type: string, isPrevious?: boolean) => false | Element; 4 | export declare const processSpinVditorSVDOM: (html: string, vditor: IVditor) => string; 5 | export declare const processPreviousMarkers: (spanElement: HTMLElement) => string; 6 | export declare const processAfterRender: (vditor: IVditor, options?: { 7 | enableAddUndoStack: boolean; 8 | enableHint: boolean; 9 | enableInput: boolean; 10 | }) => void; 11 | export declare const processHeading: (vditor: IVditor, value: string) => void; 12 | export declare const processToolbar: (vditor: IVditor, actionBtn: Element, prefix: string, suffix: string) => void; 13 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/selection.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const getEditorRange: (vditor: IVditor) => Range; 3 | export declare const getCursorPosition: (editor: HTMLElement) => { 4 | left: number; 5 | top: number; 6 | }; 7 | export declare const selectIsEditor: (editor: HTMLElement, range?: Range) => boolean; 8 | export declare const setSelectionFocus: (range: Range) => void; 9 | export declare const getSelectPosition: (selectElement: HTMLElement, editorElement: HTMLElement, range?: Range) => { 10 | end: number; 11 | start: number; 12 | }; 13 | export declare const setSelectionByPosition: (start: number, end: number, editor: HTMLElement) => Range; 14 | export declare const setRangeByWbr: (element: HTMLElement, range: Range) => void; 15 | export declare const insertHTML: (html: string, vditor: IVditor) => void; 16 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/controller/FileApplicationService.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.controller; 2 | 3 | import com.intellij.openapi.vfs.VirtualFile; 4 | 5 | import java.util.Map; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | /** 9 | * @author shuzijun 10 | */ 11 | public class FileApplicationService { 12 | 13 | private final Map myVirtualFile = new ConcurrentHashMap<>(); 14 | 15 | public void putVirtualFile(String fileName, String projectName, VirtualFile virtualFile) { 16 | myVirtualFile.put(fileName, virtualFile); 17 | } 18 | 19 | public VirtualFile getVirtualFile(String fileName, String projectName) { 20 | return myVirtualFile.get(fileName); 21 | } 22 | 23 | public void removeVirtualFile(String fileName, String projectName) { 24 | myVirtualFile.remove(fileName); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/hasClosest.d.ts: -------------------------------------------------------------------------------- 1 | export declare const hasTopClosestByClassName: (element: Node, className: string) => false | HTMLElement; 2 | export declare const hasTopClosestByAttribute: (element: Node, attr: string, value: string) => false | HTMLElement; 3 | export declare const hasTopClosestByTag: (element: Node, nodeName: string) => false | HTMLElement; 4 | export declare const getTopList: (element: Node) => false | HTMLElement; 5 | export declare const hasClosestByAttribute: (element: Node, attr: string, value: string) => false | HTMLElement; 6 | export declare const hasClosestBlock: (element: Node) => false | HTMLElement; 7 | export declare const hasClosestByMatchTag: (element: Node, nodeName: string) => false | HTMLElement; 8 | export declare const hasClosestByClassName: (element: Node, className: string) => false | HTMLElement; 9 | export declare const getLastNode: (node: Node) => Node; 10 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/util/editorCommonEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const focusEvent: (vditor: IVditor, editorElement: HTMLElement) => void; 3 | export declare const dblclickEvent: (vditor: IVditor, editorElement: HTMLElement) => void; 4 | export declare const blurEvent: (vditor: IVditor, editorElement: HTMLElement) => void; 5 | export declare const dropEvent: (vditor: IVditor, editorElement: HTMLElement) => void; 6 | export declare const copyEvent: (vditor: IVditor, editorElement: HTMLElement, copy: (event: ClipboardEvent, vditor: IVditor) => void) => void; 7 | export declare const cutEvent: (vditor: IVditor, editorElement: HTMLElement, copy: (event: ClipboardEvent, vditor: IVditor) => void) => void; 8 | export declare const scrollCenter: (vditor: IVditor) => void; 9 | export declare const hotkeyEvent: (vditor: IVditor, editorElement: HTMLElement) => void; 10 | export declare const selectEvent: (vditor: IVditor, editorElement: HTMLElement) => void; 11 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/toolbar/setToolbar.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const removeCurrentToolbar: (toolbar: { 3 | [key: string]: HTMLElement; 4 | }, names: string[]) => void; 5 | export declare const setCurrentToolbar: (toolbar: { 6 | [key: string]: HTMLElement; 7 | }, names: string[]) => void; 8 | export declare const enableToolbar: (toolbar: { 9 | [key: string]: HTMLElement; 10 | }, names: string[]) => void; 11 | export declare const disableToolbar: (toolbar: { 12 | [key: string]: HTMLElement; 13 | }, names: string[]) => void; 14 | export declare const hideToolbar: (toolbar: { 15 | [key: string]: HTMLElement; 16 | }, names: string[]) => void; 17 | export declare const showToolbar: (toolbar: { 18 | [key: string]: HTMLElement; 19 | }, names: string[]) => void; 20 | export declare const hidePanel: (vditor: IVditor, panels: string[], exceptElement?: HTMLElement) => void; 21 | export declare const toggleSubMenu: (vditor: IVditor, panelElement: HTMLElement, actionBtn: Element, level: number) => void; 22 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/MarkdownFileType.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.shuzijun.markdown.editor; 3 | 4 | import com.intellij.icons.AllIcons; 5 | import com.intellij.openapi.fileTypes.LanguageFileType; 6 | import org.intellij.plugins.markdown.lang.MarkdownLanguage; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import javax.swing.*; 11 | 12 | public class MarkdownFileType extends LanguageFileType { 13 | public static final MarkdownFileType INSTANCE = new MarkdownFileType(); 14 | 15 | private MarkdownFileType() { 16 | super(MarkdownLanguage.INSTANCE); 17 | } 18 | 19 | @NotNull 20 | @Override 21 | public String getName() { 22 | return "Markdown Editor"; 23 | } 24 | 25 | @NotNull 26 | @Override 27 | public String getDescription() { 28 | return "Markdown"; 29 | } 30 | 31 | @NotNull 32 | @Override 33 | public String getDefaultExtension() { 34 | return "md"; 35 | } 36 | 37 | @Nullable 38 | @Override 39 | public Icon getIcon() { 40 | return AllIcons.FileTypes.AddAny; 41 | } 42 | } 43 | */ 44 | -------------------------------------------------------------------------------- /assets/CustomStyle_ZH.md: -------------------------------------------------------------------------------- 1 | # 自定义样式 2 | 3 | * [English Document](https://github.com/shuzijun/markdown-editor/blob/main/assets/CustomStyle.md) 4 | 5 | - [中文文档](#简介) 6 | 7 | ## 简介 8 | 9 | 渲染的编辑器是一个html页面,这个页面默认加载的是jar包内的资源和样式,只适配了默认的暗黑主题和白色主题,如果是使用的其他主题配色可能很丑。 10 | 11 | 插件提供了一种加载外部主题的方式,可以加载固定目录下的html页面和样式。通过 *File | Settings | Tools | Markdown Editor* 找到插件的配置页,可以看到一个模板路径和同步按钮。 12 | 13 | 点击同步按钮同步默认的页面和主题到路径下,目前这个路径是插件的安装路径,暂时不可修改,并且每次重新安装插件会被清空,注意备份。 14 | 15 | 接下来就可以需要一些使用chrome的开发者工具和css的知识了,在编辑器右键会出现*open DevTools* ,打开后通过选择元素,查看样式,看到目前加载样式类型,然后根据自己的需求进行修改。 16 | 17 | 下面介绍一下同步的文件夹下的结构。 18 | 19 | ## template/default.html 20 | 21 | 这是渲染编辑器的主要页面,所有的配置项都在这个文件里,相关配置都可以在[vditor](https://github.com/Vanessa219/vditor)查到,如果有更高的自定义需求,可以查阅配置进行修改。 22 | 23 | 与主题相关的应该配置为 *"theme": darcula ? "dark" : "light"和*"current": darcula ? "idea-dark" : "idea-light"* 24 | 25 | 其中darcula变量为当前idea是否使用的darcula主题,idea-dark与idea-light主题为默认加载的主题。 26 | 27 | ## vditor/content-theme 28 | 29 | 这个目录是存放主题的地方。如果有自定完整主题的需求,可以新增一个自己的css文件,并且修改default.html中主题名称,如果只是想修改部分样式,可以通过下面的userStyle.css配置 30 | 31 | ## vditor/userStyle.css 32 | 33 | 该配置主要是提供用户自定义的样式,如果有部分修改样式的需要,可以通过开发者工具定位到元素,然后找到要修改的样式,在这个文件内进行重写。 34 | 35 | ## 最后 36 | 37 | vditor的主题没有找到相关文档,只能通过浏览器工具进行定位重写了。 38 | 39 | 欢迎各位将重写的过程,重写元素的含义和重写的主题和文件进行共享!:smile: 40 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/DevtoolsAction.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.editor; 2 | 3 | import com.intellij.openapi.actionSystem.AnAction; 4 | import com.intellij.openapi.actionSystem.AnActionEvent; 5 | import com.intellij.openapi.fileEditor.FileEditor; 6 | import com.intellij.openapi.fileEditor.FileEditorManager; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | /** 10 | * @author shuzijun 11 | */ 12 | public class DevtoolsAction extends AnAction { 13 | 14 | @Override 15 | public void update(AnActionEvent e) { 16 | FileEditor fileEditor = FileEditorManager.getInstance(e.getProject()).getSelectedEditor(); 17 | if(fileEditor != null && fileEditor instanceof MarkdownPreviewFileEditor){ 18 | e.getPresentation().setEnabledAndVisible(true); 19 | }else { 20 | e.getPresentation().setEnabledAndVisible(false); 21 | } 22 | } 23 | @Override 24 | public void actionPerformed(@NotNull AnActionEvent e) { 25 | try { 26 | MarkdownPreviewFileEditor fileEditor = (MarkdownPreviewFileEditor) FileEditorManager.getInstance(e.getProject()).getSelectedEditor(); 27 | fileEditor.openDevtools(); 28 | }catch (Exception ignore){ 29 | 30 | } 31 | 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/listener/SupportCheck.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.listener; 2 | 3 | import com.intellij.notification.Notification; 4 | import com.intellij.notification.NotificationType; 5 | import com.intellij.notification.Notifications; 6 | import com.intellij.openapi.application.ApplicationManager; 7 | import com.intellij.openapi.project.DumbAware; 8 | import com.intellij.openapi.project.Project; 9 | import com.intellij.openapi.startup.StartupActivity; 10 | import com.intellij.ui.jcef.JBCefApp; 11 | import com.shuzijun.markdown.model.PluginConstant; 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | /** 15 | * @author shuzijun 16 | */ 17 | public class SupportCheck implements StartupActivity, DumbAware { 18 | 19 | public static boolean isFirstProject = true; 20 | 21 | @Override 22 | public void runActivity(@NotNull Project project) { 23 | if (ApplicationManager.getApplication().isUnitTestMode() || !isFirstProject ) { 24 | return; 25 | } 26 | if(!JBCefApp.isSupported()){ 27 | Notifications.Bus.notify(new Notification(PluginConstant.NOTIFICATION_GROUP, "Not Support JCEF", "Your environment does not support JCEF, cannot use Markdown Editor", NotificationType.ERROR)); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/ui/OverwriteDialogWrapper.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.ui; 2 | 3 | import com.intellij.openapi.project.Project; 4 | import com.intellij.openapi.ui.DialogWrapper; 5 | import com.intellij.ui.components.JBLabel; 6 | import com.shuzijun.markdown.util.PropertiesUtils; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import javax.swing.*; 11 | 12 | /** 13 | * @author shuzijun 14 | */ 15 | public class OverwriteDialogWrapper extends DialogWrapper { 16 | 17 | private String filePath; 18 | 19 | private String tip; 20 | 21 | protected OverwriteDialogWrapper(@Nullable Project project, String filePath, String tip) { 22 | super(project); 23 | this.filePath = filePath; 24 | this.tip = tip; 25 | init(); 26 | setTitle("Overwrite File"); 27 | } 28 | 29 | @Override 30 | protected @NotNull JComponent createCenterPanel() { 31 | return new JBLabel("" + filePath + "
"+ PropertiesUtils.getInfo("overwrite.file")+"
" + tip + ""); 32 | } 33 | 34 | @Override 35 | protected @NotNull Action getOKAction() { 36 | Action action = super.getOKAction(); 37 | action.putValue(Action.NAME, "Overwrite"); 38 | return action; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # markdown-editor 2 | 3 | IntelliJ Platform A full-featured WYSIWYG editor for markdown 4 | 5 | - [English Document](#Features) 6 | - [中文文档](https://github.com/shuzijun/markdown-editor/blob/main/README_ZH.md) 7 | - Useful Links 8 | - [Custom Style](https://github.com/shuzijun/markdown-editor/blob/main/assets/CustomStyle.md) 9 | 10 | # Features 11 | 12 | * Support three editing modes: WYSIWYG, Instant Rendering and Split View 13 | * Support outline, mathematical formulas, mind maps, charts, flowcharts, Gantt charts, timing charts, heading anchors, code highlighting, graphviz rendering. 14 | * Support picture paste, file upload or drag and insert quickly. 15 | * Support using IDE to open files quickly 16 | * More function reference [vditor features](https://github.com/Vanessa219/vditor/blob/master/README_en_US.md#--features) 17 | 18 | # Introduction 19 | 20 | * After installing the plugin, open the .md file,select **Markdown Editor** at the bottom of the editor. 21 | * There is no need to uninstall the default markdown plugin. The editor of the current plugin appears after the default editor. 22 | * Ensure that the IDE supports JCEF. 23 | 24 | # Demo 25 | 26 | ![demo.gif](https://raw.githubusercontent.com/shuzijun/markdown-editor/main/assets/demo.gif) 27 | 28 | # Acknowledgement 29 | 30 | * [vditor](https://github.com/Vanessa219/vditor) 31 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/images/img-loading.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/workflows/dependencies.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: dependencies 4 | 5 | # Controls when the workflow will run 6 | on: 7 | pull_request: 8 | branches: [ main ] 9 | types: [ labeled ] 10 | 11 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 12 | jobs: 13 | # This workflow contains a single job called "build" 14 | build: 15 | if: ${{ github.event.label.name == 'dependencies approval' }} 16 | # The type of runner that the job will run on 17 | runs-on: ubuntu-latest 18 | 19 | # Steps represent a sequence of tasks that will be executed as part of the job 20 | steps: 21 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 22 | - uses: actions/checkout@v2 23 | with: 24 | ref: ${{ github.head_ref }} 25 | 26 | - name: Use Node.js 14 27 | uses: actions/setup-node@v1 28 | with: 29 | node-version: '14' 30 | - run: npm install 31 | - run: cp -rf node_modules/vditor/dist/ src/main/resources/vditor/ 32 | - uses: EndBug/add-and-commit@v7 33 | with: 34 | branch: ${{ github.head_ref }} 35 | message: 'publish vditor dist' 36 | add: "src/main/resources/vditor/" 37 | author_name: shuzijun 38 | author_email: shuzijun0109@gmail.com 39 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/listener/ErrorReportHandler.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.listener; 2 | 3 | import com.intellij.diagnostic.AbstractMessage; 4 | import com.intellij.openapi.diagnostic.ErrorReportSubmitter; 5 | import com.intellij.openapi.diagnostic.IdeaLoggingEvent; 6 | import com.intellij.util.Consumer; 7 | import com.shuzijun.markdown.util.PropertiesUtils; 8 | import com.shuzijun.markdown.util.SentryUtils; 9 | import org.jetbrains.annotations.NotNull; 10 | import org.jetbrains.annotations.Nullable; 11 | 12 | import java.awt.*; 13 | 14 | /** 15 | * @author shuzijun 16 | */ 17 | public class ErrorReportHandler extends ErrorReportSubmitter { 18 | @NotNull 19 | @Override 20 | public String getReportActionText() { 21 | return PropertiesUtils.getInfo("report"); 22 | } 23 | 24 | @Override 25 | public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo, @NotNull Component parentComponent, @NotNull Consumer consumer) { 26 | for (IdeaLoggingEvent event : events) { 27 | Throwable throwable = event.getThrowable(); 28 | if (event.getData() instanceof AbstractMessage) { 29 | throwable = ((AbstractMessage) event.getData()).getThrowable(); 30 | } 31 | 32 | SentryUtils.submitErrorReport(throwable, additionalInfo); 33 | } 34 | 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/constants.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare const _VDITOR_VERSION: string; 3 | export { _VDITOR_VERSION as VDITOR_VERSION }; 4 | export declare abstract class Constants { 5 | static readonly ZWSP: string; 6 | static readonly DROP_EDITOR: string; 7 | static readonly MOBILE_WIDTH: number; 8 | static readonly CLASS_MENU_DISABLED: string; 9 | static readonly EDIT_TOOLBARS: string[]; 10 | static readonly CODE_THEME: string[]; 11 | static readonly CODE_LANGUAGES: string[]; 12 | static readonly CDN: string; 13 | static readonly MARKDOWN_OPTIONS: { 14 | autoSpace: boolean; 15 | gfmAutoLink: boolean; 16 | codeBlockPreview: boolean; 17 | fixTermTypo: boolean; 18 | footnotes: boolean; 19 | linkBase: string; 20 | linkPrefix: string; 21 | listStyle: boolean; 22 | mark: boolean; 23 | mathBlockPreview: boolean; 24 | paragraphBeginningSpace: boolean; 25 | sanitize: boolean; 26 | toc: boolean; 27 | }; 28 | static readonly HLJS_OPTIONS: { 29 | enable: boolean; 30 | lineNumber: boolean; 31 | defaultLang: string; 32 | style: string; 33 | }; 34 | static readonly MATH_OPTIONS: IMath; 35 | static readonly THEME_OPTIONS: { 36 | current: string; 37 | list: { 38 | "ant-design": string; 39 | dark: string; 40 | light: string; 41 | wechat: string; 42 | }; 43 | path: string; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/pluginIcon.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Markdown Editor Changelog 4 | 5 | ## 2.0.5 6 | 7 | ### Added 8 | 9 | - Support Absolute Path。[#84](https://github.com/shuzijun/markdown-editor/issues/84) 10 | 11 | ### Changed 12 | 13 | - Optimize text action menu. 14 | - Upgrade vditor to `3.9.1` 15 | 16 | ### Fixed 17 | 18 | - fix [#62](https://github.com/shuzijun/markdown-editor/issues/62) 19 | 20 | ### Removed 21 | 22 | ## 2.0.4 23 | 24 | ### Added 25 | 26 | - Open file wait for animation 27 | 28 | ### Changed 29 | 30 | ### Fixed 31 | 32 | - fix [#81](https://github.com/shuzijun/markdown-editor/issues/81) 33 | - fix [#72](https://github.com/shuzijun/markdown-editor/issues/72) 34 | - fix [#65](https://github.com/shuzijun/markdown-editor/issues/65) 35 | 36 | ### Removed 37 | 38 | - Remove the shortcut key to close the search box by default 39 | 40 | ## 2.0.2 41 | 42 | ### Added 43 | 44 | ### Changed 45 | 46 | - fix [#68](https://github.com/shuzijun/markdown-editor/issues/68) 47 | 48 | ### Fixed 49 | 50 | ### Removed 51 | 52 | ## 2.0.1 53 | 54 | ### Added 55 | 56 | ### Changed 57 | 58 | - Upgrade vditor to `3.8.17` 59 | 60 | ### Fixed 61 | 62 | ### Removed 63 | 64 | ## 2.0.0 65 | 66 | ### Added 67 | 68 | ### Changed 69 | 70 | - Upgrade vditor to `3.8.14` 71 | - Modify upload file directory selection and overwrite reminder. [#43](https://github.com/shuzijun/markdown-editor/issues/43) 72 | - Modify export file directory selection and overwrite reminder. 73 | - Modify compatible to version 221 74 | 75 | ### Fixed 76 | 77 | ### Removed 78 | -------------------------------------------------------------------------------- /.github/workflows/SyncTemplate.yml: -------------------------------------------------------------------------------- 1 | # Synchronize changes to the main branch to template 2 | 3 | name: sync template 4 | 5 | # Controls when the workflow will run 6 | on: 7 | workflow_dispatch: 8 | inputs: 9 | tag: 10 | description: 'tag name' 11 | required: true 12 | 13 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 14 | jobs: 15 | # This workflow contains a single job called "build" 16 | build: 17 | # The type of runner that the job will run on 18 | runs-on: ubuntu-latest 19 | 20 | # Steps represent a sequence of tasks that will be executed as part of the job 21 | steps: 22 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 23 | - uses: actions/checkout@v2 24 | with: 25 | ref: main 26 | path: main 27 | 28 | - uses: actions/checkout@v2 29 | with: 30 | ref: template@1 31 | path: template 32 | 33 | - run: cp -rf main/src/main/resources/template/ template/ 34 | - run: cp -rf main/src/main/resources/vditor/dist/css/content-theme/idea-dark.css template/vditor/content-theme/ 35 | - run: cp -rf main/src/main/resources/vditor/dist/css/content-theme/idea-light.css template/vditor/content-theme/ 36 | 37 | - uses: EndBug/add-and-commit@v7 38 | with: 39 | branch: template@1 40 | message: 'Synchronize main' 41 | cwd: './template' 42 | author_name: shuzijun 43 | author_email: shuzijun0109@gmail.com 44 | tag: '${{ github.event.inputs.tag }} --force' 45 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/model/MarkdownResponse.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.model; 2 | 3 | 4 | import com.alibaba.fastjson.JSON; 5 | 6 | /** 7 | * @author shuzijun 8 | */ 9 | public class MarkdownResponse { 10 | 11 | private boolean success = false; 12 | 13 | private String message; 14 | 15 | private String data; 16 | 17 | public static MarkdownResponse error(String message) { 18 | return new MarkdownResponse(false, message, null); 19 | } 20 | 21 | public static MarkdownResponse success(String data) { 22 | return new MarkdownResponse(true, null, data); 23 | } 24 | 25 | public static MarkdownResponse success(String data, String message) { 26 | return new MarkdownResponse(true, message, data); 27 | } 28 | 29 | public MarkdownResponse(boolean success, String message, String data) { 30 | this.success = success; 31 | this.message = message; 32 | this.data = data; 33 | } 34 | 35 | public boolean isSuccess() { 36 | return success; 37 | } 38 | 39 | public void setSuccess(boolean success) { 40 | this.success = success; 41 | } 42 | 43 | public String getMessage() { 44 | return message; 45 | } 46 | 47 | public void setMessage(String message) { 48 | this.message = message; 49 | } 50 | 51 | public String getData() { 52 | return data; 53 | } 54 | 55 | public void setData(String data) { 56 | this.data = data; 57 | } 58 | 59 | @Override 60 | public String toString() { 61 | return JSON.toJSONString(this); 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/ts/markdown/adapterRender.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mathRenderAdapter: { 2 | getCode: (mathElement: Element) => string; 3 | getElements: (element: HTMLElement) => NodeListOf; 4 | }; 5 | export declare const mermaidRenderAdapter: { 6 | /** 不仅要返回code,并且需要将 code 设置为 el 的 innerHTML */ 7 | getCode: (el: Element) => string; 8 | getElements: (element: HTMLElement) => NodeListOf; 9 | }; 10 | export declare const markmapRenderAdapter: { 11 | getCode: (el: Element) => string; 12 | getElements: (element: HTMLElement) => NodeListOf; 13 | }; 14 | export declare const mindmapRenderAdapter: { 15 | getCode: (el: Element) => string; 16 | getElements: (el: HTMLElement | Document) => NodeListOf; 17 | }; 18 | export declare const chartRenderAdapter: { 19 | getCode: (el: HTMLElement) => string; 20 | getElements: (el: HTMLElement | Document) => NodeListOf; 21 | }; 22 | export declare const abcRenderAdapter: { 23 | getCode: (el: Element) => string; 24 | getElements: (el: HTMLElement | Document) => NodeListOf; 25 | }; 26 | export declare const graphvizRenderAdapter: { 27 | getCode: (el: Element) => string; 28 | getElements: (el: HTMLElement | Document) => NodeListOf; 29 | }; 30 | export declare const flowchartRenderAdapter: { 31 | getCode: (el: Element) => string; 32 | getElements: (el: HTMLElement | Document) => NodeListOf; 33 | }; 34 | export declare const plantumlRenderAdapter: { 35 | getCode: (el: Element) => string; 36 | getElements: (el: HTMLElement | Document) => NodeListOf; 37 | }; 38 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/model/PluginConstant.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.model; 2 | 3 | import com.intellij.openapi.application.PathManager; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * @author shuzijun 9 | */ 10 | public class PluginConstant { 11 | 12 | public static final String PLUGIN_ID = "com.shuzijun.markdown-editor"; 13 | 14 | public static final String NOTIFICATION_GROUP = "Markdown editor"; 15 | public static final String APPLICATION_CONFIGURABLE_DISPLAY_NAME = "Markdown editor"; 16 | 17 | public static final String EDITOR_TOOLBAR = "Markdown Editor Toolbar"; 18 | 19 | public static final String TEMPLATE_VERSION = "1"; 20 | public static final String TEMPLATE_PATH = PathManager.getPluginsPath() + File.separator + "markdown-editor" + File.separator + "assets" + File.separator; 21 | 22 | public static final String JS_DELIVR_ENDPOINTS = "https://data.jsdelivr.com/v1/package/gh/shuzijun/markdown-editor"; 23 | public static final String CDN = "https://cdn.jsdelivr.net/gh/shuzijun/markdown-editor@"; 24 | 25 | public static final String editorPolicyKey="markdown.editor.editorPolicy"; 26 | 27 | public static final String editorAssetsPathKey="markdown.editor.editorAssetsPath"; 28 | 29 | public static final String editorAssetsNameAutoKey="markdown.editor.editorAssetsName"; 30 | 31 | public static final String editorFixToolbarKey="markdown.editor.editorFixToolbar"; 32 | 33 | public static final String editorTextOperationKey="markdown.editor.editorTextOperation"; 34 | 35 | public static final String editorAbsolutePathKey="markdown.editor.editorAbsolutePath"; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/util/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.util; 2 | 3 | 4 | import com.intellij.openapi.application.ModalityState; 5 | import com.intellij.openapi.project.Project; 6 | import com.intellij.openapi.vfs.LocalFileSystem; 7 | import com.intellij.openapi.vfs.VirtualFile; 8 | import com.intellij.util.ModalityUiUtil; 9 | 10 | import java.io.File; 11 | import java.io.FileOutputStream; 12 | import java.io.IOException; 13 | 14 | /** 15 | * @author shuzijun 16 | */ 17 | public class FileUtils { 18 | public static String separator() { 19 | if (File.separator.equals("\\")) { 20 | return "/"; 21 | } else { 22 | return ""; 23 | } 24 | } 25 | 26 | public static void saveFile(File file, String body) throws IOException { 27 | if (!file.getParentFile().exists()) { 28 | file.getParentFile().mkdirs(); 29 | } 30 | if (!file.exists()) { 31 | file.createNewFile(); 32 | } 33 | FileOutputStream fileOutputStream = new FileOutputStream(file, Boolean.FALSE); 34 | fileOutputStream.write(body.getBytes("UTF-8")); 35 | fileOutputStream.close(); 36 | } 37 | 38 | public static void refreshProjectDirectory(Project project, String refreshPath) { 39 | ModalityUiUtil.invokeLaterIfNeeded(ModalityState.defaultModalityState(), new Runnable() { 40 | @Override 41 | public void run() { 42 | VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(refreshPath)); 43 | if (virtualFile != null) { 44 | virtualFile.refresh(true, true); 45 | } 46 | } 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/MarkdownPreviewFileEditorProvider.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.editor; 2 | 3 | 4 | import com.intellij.ide.util.PropertiesComponent; 5 | import com.intellij.openapi.fileEditor.FileEditor; 6 | import com.intellij.openapi.fileEditor.FileEditorPolicy; 7 | import com.intellij.openapi.fileEditor.WeighedFileEditorProvider; 8 | import com.intellij.openapi.fileTypes.FileType; 9 | import com.intellij.openapi.project.Project; 10 | import com.intellij.openapi.vfs.VirtualFile; 11 | import com.intellij.ui.jcef.JBCefApp; 12 | import com.shuzijun.markdown.model.PluginConstant; 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | /** 16 | * @author shuzijun 17 | */ 18 | public class MarkdownPreviewFileEditorProvider extends WeighedFileEditorProvider { 19 | @Override 20 | public boolean accept(@NotNull Project project, @NotNull VirtualFile file) { 21 | FileType fileType = file.getFileType(); 22 | return (fileType.getDefaultExtension().equals("md") || 23 | (fileType.getDefaultExtension().equals("") && file.getName().endsWith(".md"))) 24 | && JBCefApp.isSupported(); 25 | } 26 | 27 | @NotNull 28 | @Override 29 | public FileEditor createEditor(@NotNull Project project, @NotNull VirtualFile file) { 30 | return new MarkdownPreviewFileEditor(project, file); 31 | } 32 | 33 | @NotNull 34 | @Override 35 | public String getEditorTypeId() { 36 | return "Markdown Editor"; 37 | } 38 | 39 | @NotNull 40 | @Override 41 | public FileEditorPolicy getPolicy() { 42 | String editorPolicy = PropertiesComponent.getInstance().getValue(PluginConstant.editorPolicyKey,FileEditorPolicy.PLACE_AFTER_DEFAULT_EDITOR.name()); 43 | return FileEditorPolicy.valueOf(editorPolicy); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/setting/SettingConfigurable.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.setting; 2 | 3 | import com.intellij.openapi.options.ConfigurationException; 4 | import com.intellij.openapi.options.SearchableConfigurable; 5 | import com.shuzijun.markdown.model.PluginConstant; 6 | import org.jetbrains.annotations.Nls; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import javax.swing.*; 11 | 12 | /** 13 | * @author shuzijun 14 | */ 15 | public class SettingConfigurable implements SearchableConfigurable { 16 | 17 | 18 | private SettingUI mainPanel; 19 | 20 | @NotNull 21 | @Override 22 | public String getId() { 23 | return PluginConstant.APPLICATION_CONFIGURABLE_DISPLAY_NAME; 24 | } 25 | 26 | @Nls 27 | @Override 28 | public String getDisplayName() { 29 | return PluginConstant.APPLICATION_CONFIGURABLE_DISPLAY_NAME; 30 | } 31 | 32 | @Nullable 33 | @Override 34 | public String getHelpTopic() { 35 | return "markdown-editor.helpTopic"; 36 | } 37 | 38 | @Nullable 39 | @Override 40 | public Runnable enableSearch(String option) { 41 | return null; 42 | } 43 | 44 | @Nullable 45 | @Override 46 | public JComponent createComponent() { 47 | mainPanel = new SettingUI(); 48 | return mainPanel.getContentPane(); 49 | } 50 | 51 | @Override 52 | public boolean isModified() { 53 | return mainPanel.isModified(); 54 | } 55 | 56 | @Override 57 | public void apply() throws ConfigurationException { 58 | mainPanel.apply(); 59 | } 60 | 61 | @Override 62 | public void reset() { 63 | mainPanel.reset(); 64 | } 65 | 66 | @Override 67 | public void disposeUIResources() { 68 | mainPanel.disposeUIResources(); 69 | mainPanel = null; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/noerrors.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=MathJax._.components.global.isObject,t.combineConfig=MathJax._.components.global.combineConfig,t.combineDefaults=MathJax._.components.global.combineDefaults,t.combineWithMathJax=MathJax._.components.global.combineWithMathJax,t.MathJax=MathJax._.components.global.MathJax},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoErrorsConfiguration=void 0;var o=n(2);t.NoErrorsConfiguration=o.Configuration.create("noerrors",{nodes:{error:function(e,t,n,o){var r=e.create("token","mtext",{},o.replace(/\n/g," "));return e.create("node","merror",[r],{"data-mjx-error":t,title:t})}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(1);Object(o.combineWithMathJax)({_:{input:{tex:{noerrors:{NoErrorsConfiguration:r}}}}})}]); -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/controller/ResourcesController.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.controller; 2 | 3 | import com.intellij.openapi.diagnostic.Logger; 4 | import com.intellij.openapi.util.io.FileUtilRt; 5 | import io.netty.buffer.Unpooled; 6 | import io.netty.channel.ChannelHandlerContext; 7 | import io.netty.handler.codec.http.*; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.io.FileResponses; 10 | 11 | import java.io.IOException; 12 | import java.io.InputStream; 13 | 14 | /** 15 | * @author shuzijun 16 | */ 17 | public class ResourcesController extends BaseController { 18 | 19 | private static final Logger LOG = Logger.getInstance(ResourcesController.class); 20 | 21 | private final String controllerPath = "resources"; 22 | 23 | @Override 24 | public String getControllerPath() { 25 | return controllerPath; 26 | } 27 | 28 | @Override 29 | public FullHttpResponse get(@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) { 30 | String resourceName = getResourceName(urlDecoder); 31 | byte[] data; 32 | try (InputStream inputStream = PreviewStaticServer.class.getResourceAsStream(resourceName)) { 33 | if (inputStream == null) { 34 | return new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND, Unpooled.EMPTY_BUFFER); 35 | } 36 | data = FileUtilRt.loadBytes(inputStream); 37 | } catch (IOException e) { 38 | LOG.warn(e); 39 | return new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR, Unpooled.EMPTY_BUFFER); 40 | } 41 | 42 | FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.wrappedBuffer(data)); 43 | response.headers().set(HttpHeaderNames.CONTENT_TYPE, FileResponses.INSTANCE.getContentType(resourceName) + "; charset=utf-8"); 44 | response.headers().set(HttpHeaderNames.CACHE_CONTROL, "max-age=3600, private, must-revalidate"); 45 | response.headers().set(HttpHeaderNames.ETAG, Long.toString(LAST_MODIFIED)); 46 | return response; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/zh_TW.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': '置中', 3 | 'alignLeft': '置左', 4 | 'alignRight': '置右', 5 | 'alternateText': '替代文字', 6 | 'bold': '粗體', 7 | 'both': '編輯 & 預覽', 8 | 'check': '任務列表', 9 | 'close': '關閉', 10 | 'code': '代碼塊', 11 | 'code-theme': '代碼塊主題預覽', 12 | 'column': '欄', 13 | 'comment': '評論', 14 | 'confirm': '確定', 15 | 'content-theme': '內容主題預覽', 16 | 'copied': '已複製', 17 | 'copy': '複製', 18 | 'delete-column': '刪除欄', 19 | 'delete-row': '刪除列', 20 | 'devtools': '開發者工具', 21 | 'down': '下', 22 | 'downloadTip': '該瀏覽器不支持下載功能', 23 | 'edit': '編輯', 24 | 'edit-mode': '切換編輯模式', 25 | 'emoji': '表情', 26 | 'export': '匯出', 27 | 'fileTypeError': '檔案類型不允許上傳', 28 | 'footnoteRef': '腳註參考', 29 | 'fullscreen': '全螢幕切換', 30 | 'generate': '生成中', 31 | 'headings': '標題', 32 | 'heading1': '一級標題', 33 | 'heading2': '二級標題', 34 | 'heading3': '三級標題', 35 | 'heading4': '四級標題', 36 | 'heading5': '五級標題', 37 | 'heading6': '六級標題', 38 | 'help': '幫助', 39 | 'imageURL': '圖片位址', 40 | 'indent': '列表縮排', 41 | 'info': '關於', 42 | 'inline-code': '行內代碼', 43 | 'insert-after': '末尾插入列', 44 | 'insert-before': '起始插入列', 45 | 'insertColumnLeft': '在左邊插入一欄', 46 | 'insertColumnRight': '在右邊插入一欄', 47 | 'insertRowAbove': '在上方插入一行', 48 | 'insertRowBelow': '在下方插入一行', 49 | 'instantRendering': '即時渲染', 50 | 'italic': '斜體', 51 | 'language': '語言', 52 | 'line': '分隔線', 53 | 'link': '連結', 54 | 'linkRef': '連結參考', 55 | 'list': '無序列表', 56 | 'more': '更多', 57 | 'nameEmpty': '文件名不能為空', 58 | 'ordered-list': '有序列表', 59 | 'outdent': '列表反向縮排', 60 | 'outline': '大綱', 61 | 'over': '超過', 62 | 'performanceTip': '即時預覽需 ${x}ms,可點擊編輯 & 預覽按鈕進行關閉', 63 | 'preview': '預覽', 64 | 'quote': '引用', 65 | 'record': '開始錄音/結束錄音', 66 | 'record-tip': '該設備不支持錄音功能', 67 | 'recording': '錄音中...', 68 | 'redo': '重做', 69 | 'remove': '刪除', 70 | 'row': '列', 71 | 'spin': '旋轉', 72 | 'splitView': '分割預覽', 73 | 'strike': '刪除線', 74 | 'table': '表格', 75 | 'textIsNotEmpty': '文字(不能為空)', 76 | 'title': '標題', 77 | 'tooltipText': '提示文字', 78 | 'undo': '撤銷', 79 | 'up': '上', 80 | 'update': '更新', 81 | 'upload': '上傳圖片或文件', 82 | 'uploadError': '上傳錯誤', 83 | 'uploading': '上傳中...', 84 | 'wysiwyg': '所見即所得', 85 | } 86 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/zh_CN.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': '居中', 3 | 'alignLeft': '居左', 4 | 'alignRight': '居右', 5 | 'alternateText': '替代文本', 6 | 'bold': '粗体', 7 | 'both': '编辑 & 预览', 8 | 'check': '任务列表', 9 | 'close': '关闭', 10 | 'code': '代码块', 11 | 'code-theme': '代码块主题预览', 12 | 'column': '列', 13 | 'comment': '评论', 14 | 'confirm': '确定', 15 | 'content-theme': '内容主题预览', 16 | 'copied': '已复制', 17 | 'copy': '复制', 18 | 'delete-column': '删除列', 19 | 'delete-row': '删除行', 20 | 'devtools': '开发者工具', 21 | 'down': '下', 22 | 'downloadTip': '该浏览器不支持下载功能', 23 | 'edit': '编辑', 24 | 'edit-mode': '切换编辑模式', 25 | 'emoji': '表情', 26 | 'export': '导出', 27 | 'fileTypeError': '文件类型不允许上传,请压缩后再试', 28 | 'footnoteRef': '脚注标识', 29 | 'fullscreen': '全屏切换', 30 | 'generate': '生成中', 31 | 'headings': '标题', 32 | 'heading1': '一级标题', 33 | 'heading2': '二级标题', 34 | 'heading3': '三级标题', 35 | 'heading4': '四级标题', 36 | 'heading5': '五级标题', 37 | 'heading6': '六级标题', 38 | 'help': '帮助', 39 | 'imageURL': '图片地址', 40 | 'indent': '列表缩进', 41 | 'info': '关于', 42 | 'inline-code': '行内代码', 43 | 'insert-after': '末尾插入行', 44 | 'insert-before': '起始插入行', 45 | 'insertColumnLeft': '在左边插入一列', 46 | 'insertColumnRight': '在右边插入一列', 47 | 'insertRowAbove': '在上方插入一行', 48 | 'insertRowBelow': '在下方插入一行', 49 | 'instantRendering': '即时渲染', 50 | 'italic': '斜体', 51 | 'language': '语言', 52 | 'line': '分隔线', 53 | 'link': '链接', 54 | 'linkRef': '引用标识', 55 | 'list': '无序列表', 56 | 'more': '更多', 57 | 'nameEmpty': '文件名不能为空', 58 | 'ordered-list': '有序列表', 59 | 'outdent': '列表反向缩进', 60 | 'outline': '大纲', 61 | 'over': '超过', 62 | 'performanceTip': '实时预览需 ${x}ms,可点击编辑 & 预览按钮进行关闭', 63 | 'preview': '预览', 64 | 'quote': '引用', 65 | 'record': '开始录音/结束录音', 66 | 'record-tip': '该设备不支持录音功能', 67 | 'recording': '录音中...', 68 | 'redo': '重做', 69 | 'remove': '删除', 70 | 'row': '行', 71 | 'spin': '旋转', 72 | 'splitView': '分屏预览', 73 | 'strike': '删除线', 74 | 'table': '表格', 75 | 'textIsNotEmpty': '文本(不能为空)', 76 | 'title': '标题', 77 | 'tooltipText': '提示文本', 78 | 'undo': '撤销', 79 | 'up': '上', 80 | 'update': '更新', 81 | 'upload': '上传图片或文件', 82 | 'uploadError': '上传错误', 83 | 'uploading': '上传中...', 84 | 'wysiwyg': '所见即所得', 85 | } 86 | -------------------------------------------------------------------------------- /.github/workflows/Release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: 'Release version' 8 | required: true 9 | push: 10 | tags: 11 | - 'v*.*' 12 | 13 | jobs: 14 | greet: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v2 20 | 21 | - name: Set LD_VERSION 22 | if: ${{ github.event_name == 'push'}} 23 | run: echo "LD_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV 24 | - name: Set LD_VERSION 25 | if: ${{ github.event_name == 'workflow_dispatch'}} 26 | run: echo "LD_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV 27 | - name: Set PUBLISH_TOKEN 28 | run: echo "PUBLISH_TOKEN=${{ secrets.PUBLISH_TOKEN }}" >> $GITHUB_ENV 29 | 30 | - name: Set up JDK 11 31 | uses: actions/setup-java@v1 32 | with: 33 | java-version: 11 34 | 35 | - name: Grant execute permission for gradlew 36 | run: chmod +x gradlew 37 | 38 | - name: Build the plugin 39 | run: ./gradlew publishPlugin 40 | env: 41 | LD_VERSION: ${{ env.LD_VERSION }} 42 | PUBLISH_TOKEN: ${{ env.PUBLISH_TOKEN }} 43 | 44 | - name: Create Release 45 | id: create_release 46 | uses: actions/create-release@v1 47 | env: 48 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 49 | with: 50 | tag_name: v${{ env.LD_VERSION }} 51 | release_name: v${{ env.LD_VERSION }} 52 | draft: true 53 | prerelease: false 54 | 55 | - name: Upload Release Asset 56 | id: upload-release-asset 57 | uses: actions/upload-release-asset@v1 58 | env: 59 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 60 | with: 61 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 62 | asset_path: ./build/distributions/markdown-editor-${{ env.LD_VERSION }}.zip 63 | asset_name: markdown-editor-${{ env.LD_VERSION }}.zip 64 | asset_content_type: application/zip -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/controller/AssetsController.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.controller; 2 | 3 | import com.intellij.openapi.diagnostic.Logger; 4 | import com.intellij.openapi.util.io.FileUtilRt; 5 | import com.shuzijun.markdown.model.PluginConstant; 6 | import io.netty.buffer.Unpooled; 7 | import io.netty.channel.ChannelHandlerContext; 8 | import io.netty.handler.codec.http.*; 9 | import org.jetbrains.annotations.NotNull; 10 | import org.jetbrains.io.FileResponses; 11 | 12 | import java.io.FileInputStream; 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | 16 | /** 17 | * @author shuzijun 18 | */ 19 | public class AssetsController extends BaseController { 20 | 21 | private static final Logger LOG = Logger.getInstance(AssetsController.class); 22 | 23 | private final String controllerPath = "assets"; 24 | 25 | @Override 26 | public String getControllerPath() { 27 | return controllerPath; 28 | } 29 | 30 | @Override 31 | public FullHttpResponse get(@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) { 32 | String resourceName = getResourceName(urlDecoder).substring(1); 33 | byte[] data; 34 | try (InputStream inputStream = new FileInputStream(PluginConstant.TEMPLATE_PATH + resourceName)) { 35 | if (inputStream == null) { 36 | return new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND, Unpooled.EMPTY_BUFFER); 37 | } 38 | data = FileUtilRt.loadBytes(inputStream); 39 | } catch (IOException e) { 40 | LOG.warn(e); 41 | return new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR, Unpooled.EMPTY_BUFFER); 42 | } 43 | 44 | FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.wrappedBuffer(data)); 45 | response.headers().set(HttpHeaderNames.CONTENT_TYPE, FileResponses.INSTANCE.getContentType(resourceName) + "; charset=utf-8"); 46 | response.headers().set(HttpHeaderNames.CACHE_CONTROL, "max-age=0, private, must-revalidate"); 47 | response.headers().set(HttpHeaderNames.ETAG, Long.toString(LAST_MODIFIED)); 48 | return response; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/ko_KR.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': '가운데', 3 | 'alignLeft': '왼쪽', 4 | 'alignRight': '오른쪽', 5 | 'alternateText': '이미지 태그', 6 | 'bold': '굵게', 7 | 'both': '에디터 & 미리보기', 8 | 'check': '체크박스', 9 | 'close': '닫기', 10 | 'code': '코드블럭삽입', 11 | 'code-theme': '코드블럭테마', 12 | 'column': '행', 13 | 'comment': '코멘트', 14 | 'confirm': '확인', 15 | 'content-theme': '컨텐츠테마', 16 | 'copied': '복사완료', 17 | 'copy': '복사', 18 | 'delete-column': '열 삭제', 19 | 'delete-row': '행 삭제', 20 | 'devtools': '개발툴', 21 | 'down': '다운', 22 | 'downloadTip': '브라우저가 다운로드 기능을 지원하지 않습니다', 23 | 'edit': '수정', 24 | 'edit-mode': '편집모드', 25 | 'emoji': '이모지', 26 | 'export': '내보내기', 27 | 'fileTypeError': '지원하지않습니다.', 28 | 'footnoteRef': '각주참조', 29 | 'fullscreen': '전체화면', 30 | 'generate': '생성', 31 | 'headings': '제목크기', 32 | 'heading1': '첫 번째 수준 제목', 33 | 'heading2': '두 번째 수준 제목', 34 | 'heading3': '3 단계 제목', 35 | 'heading4': '제목 4', 36 | 'heading5': '5 단계 제목', 37 | 'heading6': '6 단계 제목', 38 | 'help': '도움말', 39 | 'imageURL': '이미지 URL', 40 | 'indent': '들여쓰기', 41 | 'info': '정보', 42 | 'inline-code': '인라인코드', 43 | 'insert-after': '블락 뒤로 입력', 44 | 'insert-before': '블락 앞으로 입력', 45 | 'insertColumnLeft': '왼쪽에 열 삽입', 46 | 'insertColumnRight': '오른쪽에 열 삽입', 47 | 'insertRowAbove': '위에 행 삽입', 48 | 'insertRowBelow': '아래에 행 삽입', 49 | 'instantRendering': '타이포라', 50 | 'italic': '기울임꼴', 51 | 'language': '언어', 52 | 'line': '문단나눔', 53 | 'link': '링크', 54 | 'linkRef': '링크 참조', 55 | 'list': '순서없는 목록', 56 | 'more': '더보기', 57 | 'nameEmpty': '이름이 비어있습니다.', 58 | 'ordered-list': '순서있는 목록', 59 | 'outdent': '내어쓰기', 60 | 'outline': '개요', 61 | 'over': '오버', 62 | 'performanceTip': '실시간 미리보기에는 ${x}ms가 필요하며 에디터/미리보기 버튼을 클릭하여 닫을 수 있습니다.', 63 | 'preview': '미리보기', 64 | 'quote': '인용단락', 65 | 'record': '녹음시작/녹음종료', 66 | 'record-tip': '녹음을 지원하지 않습니다.', 67 | 'recording': '녹음중...', 68 | 'redo': '되돌리기', 69 | 'remove': '삭제', 70 | 'row': '열', 71 | 'spin': '회전', 72 | 'splitView': '마크다운', 73 | 'strike': '취소선', 74 | 'table': '표삽입', 75 | 'textIsNotEmpty': '텍스트(no empty)', 76 | 'title': '표제', 77 | 'tooltipText': '툴팁', 78 | 'undo': '취소하기', 79 | 'up': '위로', 80 | 'update': '업데이트', 81 | 'upload': '이미지 업로드하기', 82 | 'uploadError': '업로드 실패', 83 | 'uploading': '업로드중...', 84 | 'wysiwyg': '위지위그', 85 | } 86 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import "./assets/less/index.less"; 3 | import VditorMethod from "./method"; 4 | declare class Vditor extends VditorMethod { 5 | readonly version: string; 6 | vditor: IVditor; 7 | /** 8 | * @param id 要挂载 Vditor 的元素或者元素 ID。 9 | * @param options Vditor 参数 10 | */ 11 | constructor(id: string | HTMLElement, options?: IOptions); 12 | /** 设置主题 */ 13 | setTheme(theme: "dark" | "classic", contentTheme?: string, codeTheme?: string, contentThemePath?: string): void; 14 | /** 获取 Markdown 内容 */ 15 | getValue(): string; 16 | /** 获取编辑器当前编辑模式 */ 17 | getCurrentMode(): "sv" | "wysiwyg" | "ir"; 18 | /** 聚焦到编辑器 */ 19 | focus(): void; 20 | /** 让编辑器失焦 */ 21 | blur(): void; 22 | /** 禁用编辑器 */ 23 | disabled(): void; 24 | /** 解除编辑器禁用 */ 25 | enable(): void; 26 | /** 返回选中的字符串 */ 27 | getSelection(): string; 28 | /** 设置预览区域内容 */ 29 | renderPreview(value?: string): void; 30 | /** 获取焦点位置 */ 31 | getCursorPosition(): { 32 | left: number; 33 | top: number; 34 | }; 35 | /** 上传是否还在进行中 */ 36 | isUploading(): boolean; 37 | /** 清除缓存 */ 38 | clearCache(): void; 39 | /** 禁用缓存 */ 40 | disabledCache(): void; 41 | /** 启用缓存 */ 42 | enableCache(): void; 43 | /** HTML 转 md */ 44 | html2md(value: string): string; 45 | /** markdown 转 JSON 输出 */ 46 | exportJSON(value: string): string; 47 | /** 获取 HTML */ 48 | getHTML(): string; 49 | /** 消息提示。time 为 0 将一直显示 */ 50 | tip(text: string, time?: number): void; 51 | /** 设置预览模式 */ 52 | setPreviewMode(mode: "both" | "editor"): void; 53 | /** 删除选中内容 */ 54 | deleteValue(): void; 55 | /** 更新选中内容 */ 56 | updateValue(value: string): void; 57 | /** 在焦点处插入内容,并默认进行 Markdown 渲染 */ 58 | insertValue(value: string, render?: boolean): void; 59 | /** 设置编辑器内容 */ 60 | setValue(markdown: string, clearStack?: boolean): void; 61 | /** 清空 undo & redo 栈 */ 62 | clearStack(): void; 63 | /** 销毁编辑器 */ 64 | destroy(): void; 65 | /** 获取评论 ID */ 66 | getCommentIds(): ICommentsData[]; 67 | /** 高亮评论 */ 68 | hlCommentIds(ids: string[]): void; 69 | /** 取消评论高亮 */ 70 | unHlCommentIds(ids: string[]): void; 71 | /** 删除评论 */ 72 | removeCommentIds(removeIds: string[]): void; 73 | private init; 74 | } 75 | export default Vditor; 76 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/ja_JP.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': '中央', 3 | 'alignLeft': '左側', 4 | 'alignRight': '右側', 5 | 'alternateText': 'イメージタグ', 6 | 'bold': '太く', 7 | 'both': 'エディター & プレビュー', 8 | 'check': 'チェックリスト', 9 | 'close': '閉じる', 10 | 'code': 'コードブロック挿入', 11 | 'code-theme': 'コードブロックテーマ', 12 | 'column': '行列', 13 | 'comment': 'コメント', 14 | 'confirm': '確認', 15 | 'content-theme': 'コンテンツテーマ', 16 | 'copied': 'コピー完了', 17 | 'copy': 'コピー', 18 | 'delete-column': '列 消去', 19 | 'delete-row': '行 消去', 20 | 'devtools': '開発ツール', 21 | 'down': '下げる', 22 | 'downloadTip': 'ブラウザがダウンロード機能をサポートしていません。', 23 | 'edit': '修正', 24 | 'edit-mode': '編集モード', 25 | 'emoji': '絵文字', 26 | 'export': 'エクスポート', 27 | 'fileTypeError': 'サポートしていません。', 28 | 'footnoteRef': '脚注参照', 29 | 'fullscreen': 'フルスクリーン', 30 | 'generate': '作成する', 31 | 'headings': '見出しの大きさ', 32 | 'heading1': '見出し1', 33 | 'heading2': '見出し2', 34 | 'heading3': '見出し3', 35 | 'heading4': '見出し4', 36 | 'heading5': '見出し5', 37 | 'heading6': '見出し6', 38 | 'help': 'ヘルプ', 39 | 'imageURL': 'イメージ URL', 40 | 'indent': '字下げ', 41 | 'info': '情報', 42 | 'inline-code': 'インラインコード', 43 | 'insert-after': 'ブロックの後ろに入力', 44 | 'insert-before': 'ブロックの前に入力', 45 | 'insertColumnLeft': '左側に列を挿入', 46 | 'insertColumnRight': '右側に列を挿入', 47 | 'insertRowAbove': '上に行を挿入', 48 | 'insertRowBelow': '下に行を挿入', 49 | 'instantRendering': 'インスタントレンダリング', 50 | 'italic': '斜体', 51 | 'language': '言語', 52 | 'line': '段落分割', 53 | 'link': 'リンク', 54 | 'linkRef': 'リンク参照', 55 | 'list': 'リスト', 56 | 'more': '詳しく見る', 57 | 'nameEmpty': '名前が入力されていません。', 58 | 'ordered-list': '順序のあるリスト', 59 | 'outdent': 'ぶら下げインデント', 60 | 'outline': '概要', 61 | 'over': 'オーバー', 62 | 'performanceTip': 'リアルタイムプレビューには、${x}msが必要でエディター/プレビューボタンをクリックして閉じる事が出来ます。', 63 | 'preview': 'プレビュー', 64 | 'quote': '引用段落', 65 | 'record': '録音開始/録音終了', 66 | 'record-tip': '録音がサポートされていません。', 67 | 'recording': '録音中...', 68 | 'redo': '戻る', 69 | 'remove': '消去', 70 | 'row': '列', 71 | 'spin': 'スピン', 72 | 'splitView': 'マークダウン', 73 | 'strike': '取り消し線', 74 | 'table': '表 挿入', 75 | 'textIsNotEmpty': 'テキスト(空白は不可)', 76 | 'title': '題名', 77 | 'tooltipText': 'ツールチップ', 78 | 'undo': '取り消す', 79 | 'up': '上げる', 80 | 'update': 'アップデート', 81 | 'upload': 'イメージをアップロードする', 82 | 'uploadError': 'アップロード失敗', 83 | 'uploading': 'アップロード中', 84 | 'wysiwyg': 'ウィジウィグ', 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/model/UploadResponse.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.model; 2 | 3 | 4 | import com.alibaba.fastjson.JSON; 5 | 6 | import java.util.ArrayList; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * @author shuzijun 13 | */ 14 | public class UploadResponse { 15 | 16 | public static UploadResponse error(String msg) { 17 | UploadResponse uploadResponse = new UploadResponse(); 18 | uploadResponse.setCode(1); 19 | uploadResponse.setMsg(msg); 20 | return uploadResponse; 21 | } 22 | 23 | public static UploadResponse success(Data data) { 24 | UploadResponse uploadResponse = new UploadResponse(); 25 | uploadResponse.setCode(0); 26 | uploadResponse.setMsg(""); 27 | uploadResponse.setData(data); 28 | return uploadResponse; 29 | } 30 | 31 | private String msg; 32 | 33 | private int code = 0; 34 | 35 | private Data data; 36 | 37 | public String getMsg() { 38 | return msg; 39 | } 40 | 41 | public void setMsg(String msg) { 42 | this.msg = msg; 43 | } 44 | 45 | public int getCode() { 46 | return code; 47 | } 48 | 49 | public void setCode(int code) { 50 | this.code = code; 51 | } 52 | 53 | public Data getData() { 54 | return data; 55 | } 56 | 57 | public void setData(Data data) { 58 | this.data = data; 59 | } 60 | 61 | public static class Data { 62 | 63 | List errFiles = new ArrayList<>(); 64 | 65 | Map succMap = new HashMap<>(); 66 | 67 | public List getErrFiles() { 68 | return errFiles; 69 | } 70 | 71 | public void setErrFiles(List errFiles) { 72 | this.errFiles = errFiles; 73 | } 74 | 75 | public void addErrFiles(String errFile) { 76 | this.errFiles.add(errFile); 77 | } 78 | 79 | public Map getSuccMap() { 80 | return succMap; 81 | } 82 | 83 | public void setSuccMap(Map succMap) { 84 | this.succMap = succMap; 85 | } 86 | 87 | public void addSuccMap(String fileName, String filePath) { 88 | this.succMap.put(fileName, filePath); 89 | } 90 | } 91 | 92 | @Override 93 | public String toString() { 94 | return JSON.toJSONString(this); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/controller/PreviewStaticServer.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.controller; 2 | 3 | import com.intellij.openapi.diagnostic.Logger; 4 | import io.netty.channel.ChannelHandlerContext; 5 | import io.netty.handler.codec.http.FullHttpRequest; 6 | import io.netty.handler.codec.http.HttpMethod; 7 | import io.netty.handler.codec.http.HttpRequest; 8 | import io.netty.handler.codec.http.QueryStringDecoder; 9 | import org.jetbrains.annotations.NotNull; 10 | import org.jetbrains.ide.HttpRequestHandler; 11 | 12 | import java.io.IOException; 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | /** 17 | * @author shuzijun 18 | */ 19 | public class PreviewStaticServer extends HttpRequestHandler { 20 | 21 | private static final Logger LOG = Logger.getInstance(PreviewStaticServer.class); 22 | 23 | public static final String PREFIX = "/d5762d7c-840b-4d0b-bd5d-639850d2b4e2/"; 24 | 25 | public static final Map route = new HashMap<>(); 26 | static { 27 | new AssetsController().addRoute(route); 28 | new MarkdownFileController().addRoute(route); 29 | new ResourcesController().addRoute(route); 30 | new UploadFileController().addRoute(route); 31 | new ExportFileController().addRoute(route); 32 | } 33 | 34 | public static PreviewStaticServer getInstance() { 35 | return HttpRequestHandler.Companion.getEP_NAME().findExtension(PreviewStaticServer.class); 36 | } 37 | 38 | @Override 39 | public boolean isAccessible(@NotNull HttpRequest request) { 40 | return true; 41 | } 42 | 43 | @Override 44 | public boolean isSupported(@NotNull FullHttpRequest request) { 45 | return (request.method() == HttpMethod.GET || request.method() == HttpMethod.HEAD || request.method() == HttpMethod.POST) && request.uri().startsWith(PREFIX); 46 | } 47 | 48 | @Override 49 | public boolean process(@NotNull QueryStringDecoder urlDecoder, 50 | @NotNull FullHttpRequest request, 51 | @NotNull ChannelHandlerContext context) throws IOException { 52 | final String path = urlDecoder.path(); 53 | if (!path.startsWith(PREFIX)) { 54 | throw new IllegalStateException("prefix should have been checked by #isSupported"); 55 | } 56 | 57 | for (String controllerPath : route.keySet()) { 58 | if (path.startsWith(controllerPath)) { 59 | route.get(controllerPath).process(urlDecoder, request, context); 60 | return true; 61 | } 62 | } 63 | return false; 64 | } 65 | 66 | 67 | } -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/noundefined.js: -------------------------------------------------------------------------------- 1 | !function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=3)}([function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isObject=MathJax._.components.global.isObject,n.combineConfig=MathJax._.components.global.combineConfig,n.combineDefaults=MathJax._.components.global.combineDefaults,n.combineWithMathJax=MathJax._.components.global.combineWithMathJax,n.MathJax=MathJax._.components.global.MathJax},function(e,n,t){"use strict";var o=this&&this.__values||function(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],o=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0}),n.NoUndefinedConfiguration=void 0;var r=t(2);n.NoUndefinedConfiguration=r.Configuration.create("noundefined",{fallback:{macro:function(e,n){var t,r,i=e.create("text","\\"+n),a=e.options.noundefined||{},u={};try{for(var f=o(["color","background","size"]),c=f.next();!c.done;c=f.next()){var l=c.value;a[l]&&(u["math"+l]=a[l])}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}e.Push(e.create("node","mtext",[],u,i))}},options:{noundefined:{color:"red",background:"",size:""}},priority:3})},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Configuration=MathJax._.input.tex.Configuration.Configuration,n.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,n.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},function(e,n,t){"use strict";t.r(n);var o=t(0),r=t(1);Object(o.combineWithMathJax)({_:{input:{tex:{noundefined:{NoUndefinedConfiguration:r}}}}})}]); -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/en_US.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': 'Center', 3 | 'alignLeft': 'Left', 4 | 'alignRight': 'Right', 5 | 'alternateText': 'Alternate text', 6 | 'bold': 'Bold', 7 | 'both': 'editor & preview', 8 | 'check': 'Task List', 9 | 'close': 'Close', 10 | 'code': 'Code Block', 11 | 'code-theme': 'Code Block Theme Preview', 12 | 'column': 'Column', 13 | 'comment': 'Comment', 14 | 'confirm': 'Confirm', 15 | 'content-theme': 'Content Theme Preview', 16 | 'copied': 'Copied', 17 | 'copy': 'Copy', 18 | 'delete-column': 'Delete Row', 19 | 'delete-row': 'Delete Column', 20 | 'devtools': 'DevTools', 21 | 'down': 'Down', 22 | 'downloadTip': 'The browser does not support the download function', 23 | 'edit': 'Edit', 24 | 'edit-mode': 'Toggle Edit Mode', 25 | 'emoji': 'Emoji', 26 | 'export': 'Export', 27 | 'fileTypeError': 'file type is error', 28 | 'footnoteRef': 'Footnote Ref', 29 | 'fullscreen': 'Toggle Fullscreen', 30 | 'generate': 'Generating', 31 | 'headings': 'Headings', 32 | 'heading1': 'Heading 1', 33 | 'heading2': 'Heading 2', 34 | 'heading3': 'Heading 3', 35 | 'heading4': 'Heading 4', 36 | 'heading5': 'Heading 5', 37 | 'heading6': 'Heading 6', 38 | 'help': 'Help', 39 | 'imageURL': 'image URL', 40 | 'indent': 'Indent', 41 | 'info': 'Info', 42 | 'inline-code': 'Inline Code', 43 | 'insert-after': 'Insert line after', 44 | 'insert-before': 'Insert line before', 45 | 'insertColumnLeft': 'Insert 1 left', 46 | 'insertColumnRight': 'Insert 1 right', 47 | 'insertRowAbove': 'Insert 1 above', 48 | 'insertRowBelow': 'Insert 1 below', 49 | 'instantRendering': 'Instant Rendering', 50 | 'italic': 'Italic', 51 | 'language': 'Language', 52 | 'line': 'Line', 53 | 'link': 'Link', 54 | 'linkRef': 'Link Ref', 55 | 'list': 'List', 56 | 'more': 'More', 57 | 'nameEmpty': 'Name is empty', 58 | 'ordered-list': 'Order List', 59 | 'outdent': 'Outdent', 60 | 'outline': 'Outline', 61 | 'over': 'over', 62 | 'performanceTip': 'Real-time preview requires ${x}ms, you can close it', 63 | 'preview': 'Preview', 64 | 'quote': 'Quote', 65 | 'record': 'Start Record/End Record', 66 | 'record-tip': 'The device does not support recording', 67 | 'recording': 'recording...', 68 | 'redo': 'Redo', 69 | 'remove': 'Remove', 70 | 'row': 'Row', 71 | 'spin': 'Spin', 72 | 'splitView': 'Split View', 73 | 'strike': 'Strike', 74 | 'table': 'Table', 75 | 'textIsNotEmpty': 'text(no empty)', 76 | 'title': 'Title', 77 | 'tooltipText': 'Tooltip text', 78 | 'undo': 'Undo', 79 | 'up': 'Up', 80 | 'update': 'Update', 81 | 'upload': 'Upload image or file', 82 | 'uploadError': 'upload error', 83 | 'uploading': 'uploading...', 84 | 'wysiwyg': 'WYSIWYG', 85 | } 86 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/highlight.js/yul.min.js: -------------------------------------------------------------------------------- 1 | hljs.registerLanguage("yul",(()=>{"use strict";function e(){try{return!0 2 | }catch(e){return!1}} 3 | var a=/-?(\b0[xX]([a-fA-F0-9]_?)*[a-fA-F0-9]|(\b[1-9](_?\d)*(\.((\d_?)*\d)?)?|\.\d(_?\d)*)([eE][-+]?\d(_?\d)*)?|\b0)(?!\w|\$)/ 4 | ;e()&&(a=a.source.replace(/\\b/g,"(?{ 14 | var a=d(e),n=r(e),o=/[A-Za-z_$][A-Za-z_$0-9.]*/,c=e.inherit(e.TITLE_MODE,{ 15 | begin:/[A-Za-z$_][0-9A-Za-z$_]*/,lexemes:o,keywords:t}),u={className:"params", 16 | begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,lexemes:o,keywords:t, 17 | contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,n,s]},b={ 18 | className:"operator",begin:/:=|->/};return{keywords:t,lexemes:o, 19 | contains:[a,n,i,l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,b,{ 20 | className:"function",lexemes:o,beginKeywords:"function",end:"{",excludeEnd:!0, 21 | contains:[c,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b]}]}}, 22 | solAposStringMode:d,solQuoteStringMode:r,HEX_APOS_STRING_MODE:i, 23 | HEX_QUOTE_STRING_MODE:l,SOL_NUMBER:s,isNegativeLookbehindAvailable:e} 24 | ;const{SOL_ASSEMBLY_KEYWORDS:o,baseAssembly:c,isNegativeLookbehindAvailable:u}=n 25 | ;return e=>{var a={keyword:o.keyword+" object code data", 26 | built_in:o.built_in+" datasize dataoffset datacopy setimmutable loadimmutable linkersymbol memoryguard", 27 | literal:o.literal},s=/\bverbatim_[1-9]?[0-9]i_[1-9]?[0-9]o\b(?!\$)/ 28 | ;u()&&(s=s.source.replace(/\\b/,"(? 2 | import * as adapterRender from "./ts/markdown/adapterRender"; 3 | declare class Vditor { 4 | /** 点击图片放大 */ 5 | static adapterRender: typeof adapterRender; 6 | /** 点击图片放大 */ 7 | static previewImage: (oldImgElement: HTMLImageElement, lang?: "en_US" | "fr_FR" | "pt_BR" | "ja_JP" | "ko_KR" | "ru_RU" | "sv_SE" | "zh_CN" | "zh_TW", theme?: string) => void; 8 | /** 为 element 中的代码块添加复制按钮 */ 9 | static codeRender: (element: HTMLElement) => void; 10 | /** 对 graphviz 进行渲染 */ 11 | static graphvizRender: (element: HTMLElement, cdn?: string) => void; 12 | /** 为 element 中的代码块进行高亮渲染 */ 13 | static highlightRender: (hljsOption?: IHljs, element?: HTMLElement | Document, cdn?: string) => void; 14 | /** 对数学公式进行渲染 */ 15 | static mathRender: (element: HTMLElement, options?: { 16 | cdn?: string; 17 | math?: IMath; 18 | }) => void; 19 | /** 流程图/时序图/甘特图渲染 */ 20 | static mermaidRender: (element: HTMLElement, cdn: string, theme: string) => void; 21 | /** 支持markdown的思维导图 */ 22 | static markmapRender: (element: HTMLElement, cdn: string, theme: string) => void; 23 | /** flowchart.js 渲染 */ 24 | static flowchartRender: (element: HTMLElement, cdn?: string) => void; 25 | /** 图表渲染 */ 26 | static chartRender: (element: HTMLElement | Document, cdn: string, theme: string) => void; 27 | /** 五线谱渲染 */ 28 | static abcRender: (element?: HTMLElement | Document, cdn?: string) => void; 29 | /** 脑图渲染 */ 30 | static mindmapRender: (element: HTMLElement | Document, cdn: string, theme: string) => void; 31 | /** plantuml渲染 */ 32 | static plantumlRender: (element?: HTMLElement | Document, cdn?: string) => void; 33 | /** 大纲渲染 */ 34 | static outlineRender: (contentElement: HTMLElement, targetElement: Element, vditor?: IVditor) => string; 35 | /** 为[特定链接](https://github.com/Vanessa219/vditor/issues/7)分别渲染为视频、音频、嵌入的 iframe */ 36 | static mediaRender: (element: HTMLElement) => void; 37 | /** 对选中的文字进行阅读 */ 38 | static speechRender: (element: HTMLElement, lang?: "en_US" | "fr_FR" | "pt_BR" | "ja_JP" | "ko_KR" | "ru_RU" | "sv_SE" | "zh_CN" | "zh_TW") => void; 39 | /** 对图片进行懒加载 */ 40 | static lazyLoadImageRender: (element?: HTMLElement | Document) => boolean; 41 | /** Markdown 文本转换为 HTML,该方法需使用[异步编程](https://ld246.com/article/1546828434083?r=Vaness) */ 42 | static md2html: (mdText: string, options?: IPreviewOptions) => Promise; 43 | /** 页面 Markdown 文章渲染 */ 44 | static preview: (previewElement: HTMLDivElement, markdown: string, options?: IPreviewOptions) => Promise; 45 | /** 设置代码主题 */ 46 | static setCodeTheme: (codeTheme: string, cdn?: string) => void; 47 | /** 设置内容主题 */ 48 | static setContentTheme: (contentTheme: string, path: string) => void; 49 | } 50 | export default Vditor; 51 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/util/SentryUtils.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.util; 2 | 3 | import com.intellij.ide.plugins.PluginManagerCore; 4 | import com.intellij.openapi.application.ApplicationInfo; 5 | import com.intellij.openapi.application.impl.ApplicationInfoImpl; 6 | import com.intellij.openapi.extensions.PluginId; 7 | import com.intellij.openapi.util.SystemInfo; 8 | import com.intellij.openapi.util.text.StringUtil; 9 | import com.shuzijun.markdown.model.PluginConstant; 10 | import io.sentry.SentryClient; 11 | import io.sentry.SentryClientFactory; 12 | import io.sentry.context.Context; 13 | import io.sentry.event.EventBuilder; 14 | import io.sentry.event.helper.EventBuilderHelper; 15 | 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | /** 20 | * @author shuzijun 21 | */ 22 | public class SentryUtils { 23 | 24 | public static void submitErrorReport(Throwable error, String description) { 25 | 26 | final SentryClient sentry = SentryClientFactory.sentryClient("https://d1fa540b8bd047beb4e0ac3f66ad50f9@o291873.ingest.sentry.io/5875324"); 27 | 28 | final ApplicationInfoImpl applicationInfo = (ApplicationInfoImpl) ApplicationInfo.getInstance(); 29 | 30 | EventBuilderHelper eventBuilder = new EventBuilderHelper() { 31 | @Override 32 | public void helpBuildingEvent(EventBuilder eventBuilder) { 33 | final Map os = new HashMap<>(); 34 | os.put("name", SystemInfo.OS_NAME); 35 | os.put("version", SystemInfo.OS_VERSION); 36 | os.put("kernel_version", SystemInfo.OS_ARCH); 37 | 38 | final Map runtime = new HashMap<>(); 39 | final String ideName = applicationInfo.getBuild().getProductCode(); 40 | runtime.put("name", ideName); 41 | runtime.put("version", applicationInfo.getFullVersion()); 42 | 43 | final Map> contexts = new HashMap<>(); 44 | contexts.put("os", os); 45 | contexts.put("runtime", runtime); 46 | 47 | eventBuilder.withContexts(contexts); 48 | 49 | if (!StringUtil.isEmptyOrSpaces(description)) { 50 | eventBuilder.withMessage(description); 51 | eventBuilder.withTag("with-description", "true"); 52 | } 53 | } 54 | }; 55 | 56 | sentry.addBuilderHelper(eventBuilder); 57 | 58 | final Context context = sentry.getContext(); 59 | 60 | 61 | context.addTag("javaVersion", SystemInfo.JAVA_RUNTIME_VERSION); 62 | context.addTag("pluginVersion", PluginManagerCore.getPlugin(PluginId.getId(PluginConstant.PLUGIN_ID)).getVersion()); 63 | if(error == null){ 64 | sentry.sendMessage(description); 65 | }else { 66 | sentry.sendException(error); 67 | } 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/ui/ExportFileDialogWrapper.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
59 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/sv_SE.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': 'Centrera', 3 | 'alignLeft': 'Vänsterställ', 4 | 'alignRight': 'Högerställ', 5 | 'alternateText': 'Alternativ text', 6 | 'bold': 'Fet', 7 | 'both': 'editera & granska', 8 | 'check': 'Att göra lista', 9 | 'close': 'Stäng', 10 | 'code': 'Kodblock', 11 | 'code-theme': 'Granska tema för kodblock', 12 | 'column': 'Kolumn', 13 | 'comment': 'Kommentera', 14 | 'confirm': 'Bekräfta', 15 | 'content-theme': 'Granska tema för innehåll', 16 | 'copied': 'Kopierad', 17 | 'copy': 'Kopiera', 18 | 'delete-column': 'Radera Kolumn', 19 | 'delete-row': 'Radera Rad', 20 | 'devtools': 'Utveckingsverktyg', 21 | 'down': 'Ner', 22 | 'downloadTip': 'Webläsaren kan ej hantera funktionen nedladdning', 23 | 'edit': 'Redigera', 24 | 'edit-mode': 'Skfta Redigeringsläge', 25 | 'emoji': 'Emoji', 26 | 'export': 'Exportera', 27 | 'fileTypeError': 'Fel filtyp', 28 | 'footnoteRef': 'Fotnotreferens', 29 | 'fullscreen': 'Skifta fullskärmsläge', 30 | 'generate': 'Genererar', 31 | 'headings': 'Rubriker', 32 | 'heading1': 'Rubriknivå 1', 33 | 'heading2': 'Rubriknivå 2', 34 | 'heading3': 'Rubriknivå 3', 35 | 'heading4': 'Rubriknivå 4', 36 | 'heading5': 'Rubriknivå 5', 37 | 'heading6': 'Rubriknivå 6', 38 | 'help': 'Hjälp', 39 | 'imageURL': 'Bildlänk (URL)', 40 | 'indent': 'Dra in', 41 | 'info': 'Info', 42 | 'inline-code': 'Dra in kod', 43 | 'insert-after': 'Infoga rad efter', 44 | 'insert-before': 'Infoga rad innan', 45 | 'insertColumnLeft': 'Infoga kolumn till vänster', 46 | 'insertColumnRight': 'Infoga kolumn till höger', 47 | 'insertRowAbove': 'Infoga rad ovan', 48 | 'insertRowBelow': 'Infoga rad under', 49 | 'instantRendering': 'Omedelbar Rendering', 50 | 'italic': 'Kursiv', 51 | 'language': 'Språk', 52 | 'line': 'Linje', 53 | 'link': 'Länk', 54 | 'linkRef': 'Länk Ref', 55 | 'list': 'Lista', 56 | 'more': 'Mer', 57 | 'nameEmpty': 'Namn saknas', 58 | 'ordered-list': 'Ordnad Lista', 59 | 'outdent': 'Dra ut', 60 | 'outline': 'Disponera', 61 | 'over': 'över', 62 | 'performanceTip': 'Granskning i realtid kräver ${x}ms, du kan stänga det', 63 | 'preview': 'Granska', 64 | 'quote': 'Citera', 65 | 'record': 'Börja inspelning/Avsluta inspelning', 66 | 'record-tip': 'Enheten stödjer inte inspelning', 67 | 'recording': 'spelar in...', 68 | 'redo': 'Gör om', 69 | 'remove': 'Ta bort', 70 | 'row': 'Rad', 71 | 'spin': 'Snurra', 72 | 'splitView': 'Splittad Vy', 73 | 'strike': 'Genomstruket', 74 | 'table': 'Tabell', 75 | 'textIsNotEmpty': 'text(ej tom)', 76 | 'title': 'Titel', 77 | 'tooltipText': 'Tooltip text', 78 | 'undo': 'Ångra', 79 | 'up': 'Upp', 80 | 'update': 'Uppdatera', 81 | 'upload': 'Ladda upp bild eller fil', 82 | 'uploadError': 'uppladdningsfel', 83 | 'uploading': 'laddar upp...', 84 | 'wysiwyg': 'WYSIWYG', 85 | } 86 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/pt_BR.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': 'Centralizar', 3 | 'alignLeft': 'Alinhar à esquerda', 4 | 'alignRight': 'Alinhar à direita', 5 | 'alternateText': 'Texto alternativo', 6 | 'bold': 'Negrito', 7 | 'both': 'Editor e visualização', 8 | 'check': 'Lista de tarefas', 9 | 'close': 'Fechar', 10 | 'code': 'Bloco de código', 11 | 'code-theme': 'Tema de bloco de código', 12 | 'column': 'Coluna', 13 | 'comment': 'Comentário', 14 | 'confirm': 'Confirmar', 15 | 'content-theme': 'Tema de conteúdo', 16 | 'copied': 'Copiado', 17 | 'copy': 'Copiar', 18 | 'delete-column': 'Excluir coluna', 19 | 'delete-row': 'Excluir linha', 20 | 'devtools': 'Ferramentas de desenvolvimento', 21 | 'down': 'Para baixo', 22 | 'downloadTip': 'O navegador não suporta a função de download', 23 | 'edit': 'Editar', 24 | 'edit-mode': 'Alternar modo de edição', 25 | 'emoji': 'Emoji', 26 | 'export': 'Exportar', 27 | 'fileTypeError': 'Tipo de arquivo incorreto', 28 | 'footnoteRef': 'Referência de rodapé', 29 | 'fullscreen': 'Alternar tela cheia', 30 | 'generate': 'Gerando', 31 | 'headings': 'Cabeçalhos', 32 | 'heading1': 'Cabeçalho 1', 33 | 'heading2': 'Cabeçalho 2', 34 | 'heading3': 'Cabeçalho 3', 35 | 'heading4': 'Cabeçalho 4', 36 | 'heading5': 'Cabeçalho 5', 37 | 'heading6': 'Cabeçalho 6', 38 | 'help': 'Ajuda', 39 | 'imageURL': 'URL da imagem', 40 | 'indent': 'Recuar', 41 | 'info': 'Informação', 42 | 'inline-code': 'Código em linha', 43 | 'insert-after': 'Inserir linha depois', 44 | 'insert-before': 'Inserir linha antes', 45 | 'insertColumnLeft': 'Inserir 1 à esquerda', 46 | 'insertColumnRight': 'Inserir 1 à direita', 47 | 'insertRowAbove': 'Inserir 1 acima', 48 | 'insertRowBelow': 'Inserir 1 abaixo', 49 | 'instantRendering': 'Renderização instantânea', 50 | 'italic': 'Itálico', 51 | 'language': 'Idioma', 52 | 'line': 'Linha', 53 | 'link': 'Link', 54 | 'linkRef': 'Referência de link', 55 | 'list': 'Lista', 56 | 'more': 'Mais', 57 | 'nameEmpty': 'Nome está vazio', 58 | 'ordered-list': 'Lista ordenada', 59 | 'outdent': 'Recuar para fora', 60 | 'outline': 'Esboço', 61 | 'over': 'sobre', 62 | 'performanceTip': 'A visualização em tempo real requer ${x}ms, você pode fechá-la', 63 | 'preview': 'Visualização', 64 | 'quote': 'Citação', 65 | 'record': 'Iniciar gravação/Encerrar gravação', 66 | 'record-tip': 'O dispositivo não suporta gravação', 67 | 'recording': 'gravando...', 68 | 'redo': 'Refazer', 69 | 'remove': 'Remover', 70 | 'row': 'Linha', 71 | 'spin': 'Girar', 72 | 'splitView': 'Visão dividida', 73 | 'strike': 'Riscado', 74 | 'table': 'Tabela', 75 | 'textIsNotEmpty': 'Texto (não vazio)', 76 | 'title': 'Título', 77 | 'tooltipText': 'Texto da dica de ferramenta', 78 | 'undo': 'Desfazer', 79 | 'up': 'Para cima', 80 | 'update': 'Atualizar', 81 | 'upload': 'Enviar imagem ou arquivo', 82 | 'uploadError': 'Erro no envio', 83 | 'uploading': 'Enviando...', 84 | 'wysiwyg': 'WYSIWYG', 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/ui/ExportFileDialogWrapper.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.ui; 2 | 3 | import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; 4 | import com.intellij.openapi.project.Project; 5 | import com.intellij.openapi.ui.DialogWrapper; 6 | import com.intellij.openapi.ui.TextBrowseFolderListener; 7 | import com.intellij.openapi.ui.TextFieldWithBrowseButton; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | import javax.swing.*; 12 | import java.awt.event.ActionEvent; 13 | import java.io.File; 14 | 15 | /** 16 | * @author shuzijun 17 | */ 18 | public class ExportFileDialogWrapper extends DialogWrapper { 19 | private JPanel jpanel; 20 | private JTextField fileNameField; 21 | private TextFieldWithBrowseButton directoryButton; 22 | 23 | private Project project; 24 | 25 | public ExportFileDialogWrapper(@Nullable Project project, String path, String fileName, String type) { 26 | super(project, true); 27 | this.project = project; 28 | directoryButton.addBrowseFolderListener(new TextBrowseFolderListener(FileChooserDescriptorFactory.createSingleFolderDescriptor()) { 29 | }); 30 | directoryButton.setText(path); 31 | fileNameField.setText(fileName); 32 | init(); 33 | setTitle("Export" + type.toUpperCase()); 34 | } 35 | 36 | @Override 37 | protected @Nullable JComponent createCenterPanel() { 38 | return jpanel; 39 | } 40 | 41 | public FileSetting getSetting() { 42 | 43 | return new FileSetting(directoryButton.getText(), fileNameField.getText()); 44 | } 45 | 46 | @Override 47 | protected @NotNull Action getOKAction() { 48 | return new OkAction() { 49 | 50 | @Override 51 | protected void doAction(ActionEvent e) { 52 | File file = new File(getSetting().filePath()); 53 | if (file.exists()) { 54 | if (!new OverwriteDialogWrapper(project, file.getPath(), "").showAndGet()) { 55 | return; 56 | } 57 | } else if (file.getParentFile().exists()) { 58 | file.getParentFile().mkdirs(); 59 | } 60 | super.doAction(e); 61 | } 62 | }; 63 | } 64 | 65 | 66 | public static class FileSetting { 67 | 68 | private boolean ok; 69 | 70 | private String directory; 71 | 72 | private String name; 73 | 74 | 75 | public FileSetting() { 76 | } 77 | 78 | public FileSetting(String directory, String name) { 79 | this.ok = true; 80 | this.directory = directory; 81 | this.name = name; 82 | } 83 | 84 | public boolean isOk() { 85 | return ok; 86 | } 87 | 88 | 89 | public String filePath() { 90 | return directory + File.separator + name; 91 | } 92 | 93 | 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/i18n/fr_FR.js: -------------------------------------------------------------------------------- 1 | window.VditorI18n = { 2 | 'alignCenter': 'Centré', 3 | 'alignLeft': 'Gauche', 4 | 'alignRight': 'Droite', 5 | 'alternateText': 'Texte de remplacement', 6 | 'bold': 'Gras', 7 | 'both': 'éditeur & prévisualisation', 8 | 'check': 'Liste de tâches', 9 | 'close': 'Fermer', 10 | 'code': 'Bloc de code', 11 | 'code-theme': 'Thème pour le bloc de code', 12 | 'column': 'Colonne', 13 | 'comment': 'Commentaire', 14 | 'confirm': 'Confirmez', 15 | 'content-theme': 'Thème pour le contenu', 16 | 'copied': 'Copié', 17 | 'copy': 'Copier', 18 | 'delete-column': 'Enlever ligne', 19 | 'delete-row': 'Enlever colonne', 20 | 'devtools': 'Outils de dev', 21 | 'down': 'Bas', 22 | 'downloadTip': 'Le navigateur ne permet pas le téléversement', 23 | 'edit': 'Editer', 24 | 'edit-mode': 'Changer le mode d\'édition', 25 | 'emoji': 'Emoji', 26 | 'export': 'Export', 27 | 'fileTypeError': 'erreur de type de fichier', 28 | 'footnoteRef': 'Ref. notes de pied de page', 29 | 'fullscreen': 'Bascule en plein écran', 30 | 'generate': 'Création', 31 | 'headings': 'Titres', 32 | 'heading1': 'Titre 1', 33 | 'heading2': 'Titre 2', 34 | 'heading3': 'Titre 3', 35 | 'heading4': 'Titre 4', 36 | 'heading5': 'Titre 5', 37 | 'heading6': 'Titre 6', 38 | 'help': 'Aide', 39 | 'imageURL': 'URL de l\'image', 40 | 'indent': 'Augmenter le retrait', 41 | 'info': 'Info', 42 | 'inline-code': 'Code en ligne', 43 | 'insert-after': 'Insérer une ligne après', 44 | 'insert-before': 'Insérer une ligne avant', 45 | 'insertColumnLeft': 'Insérer col. à gauche', 46 | 'insertColumnRight': 'Insérer col. à droite', 47 | 'insertRowAbove': 'Insérer 1 au dessus', 48 | 'insertRowBelow': 'Insérer 1 en dessous', 49 | 'instantRendering': 'Aperçu instantané', 50 | 'italic': 'Italique', 51 | 'language': 'Langage', 52 | 'line': 'Ligne', 53 | 'link': 'Lien', 54 | 'linkRef': 'Réf. Lien', 55 | 'list': 'Liste', 56 | 'more': 'Plus', 57 | 'nameEmpty': 'Nom est vide', 58 | 'ordered-list': 'Liste ordonnée', 59 | 'outdent': 'Réduire le retrait', 60 | 'outline': 'Table des matières', 61 | 'over': 'survol', 62 | 'performanceTip': 'La prévisualisation temps réel prend ${x}ms, vous pouvez fermer', 63 | 'preview': 'Prévisualisation', 64 | 'quote': 'Citation', 65 | 'record': 'Démarrer/Stopper l\'enregistrement', 66 | 'record-tip': 'L\'appareil ne supporte pas l\'enregistrement', 67 | 'recording': 'Enregistrement en cours...', 68 | 'redo': 'Rétablir', 69 | 'remove': 'Enlever', 70 | 'row': 'Ligne', 71 | 'spin': 'Rotation', 72 | 'splitView': 'Vue scindée', 73 | 'strike': 'Barré', 74 | 'table': 'Table', 75 | 'textIsNotEmpty': 'texte(pas vide)', 76 | 'title': 'Titre', 77 | 'tooltipText': 'Texte au survol', 78 | 'undo': 'Annuler', 79 | 'up': 'Haut', 80 | 'update': 'Mettre à jour', 81 | 'upload': 'Téléverser image ou fichier', 82 | 'uploadError': 'erreur de téléversement', 83 | 'uploading': 'Téléversement en cours...', 84 | 'wysiwyg': 'WYSIWYG', 85 | } 86 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/editor/ProxyLoadHtmlResourceHandler.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.editor; 2 | 3 | import com.intellij.openapi.diagnostic.Logger; 4 | import io.netty.handler.codec.http.HttpHeaderNames; 5 | import org.cef.callback.CefCallback; 6 | import org.cef.handler.CefResourceHandlerAdapter; 7 | import org.cef.misc.IntRef; 8 | import org.cef.misc.StringRef; 9 | import org.cef.network.CefRequest; 10 | import org.cef.network.CefResponse; 11 | import org.jetbrains.annotations.NotNull; 12 | 13 | import java.io.ByteArrayInputStream; 14 | import java.io.IOException; 15 | import java.io.InputStream; 16 | import java.nio.charset.StandardCharsets; 17 | import java.util.Map; 18 | 19 | /** 20 | * @author shuzijun 21 | */ 22 | public class ProxyLoadHtmlResourceHandler extends CefResourceHandlerAdapter { 23 | private static final Logger LOG = Logger.getInstance(ProxyLoadHtmlResourceHandler.class.getName()); 24 | 25 | @NotNull 26 | private final InputStream myInputStream; 27 | private final Map header ; 28 | private final int status; 29 | 30 | public ProxyLoadHtmlResourceHandler(@NotNull String html,Map header,int status) { 31 | myInputStream = new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8)); 32 | this.header = header; 33 | this.status = status; 34 | } 35 | 36 | @Override 37 | public boolean processRequest(@NotNull CefRequest request, @NotNull CefCallback callback) { 38 | callback.Continue(); 39 | return true; 40 | } 41 | 42 | @Override 43 | public void getResponseHeaders(@NotNull CefResponse response, IntRef response_length, StringRef redirectUrl) { 44 | header.forEach((key,value) -> { 45 | response.setHeaderByName(key,value,true); 46 | if(HttpHeaderNames.CONTENT_TYPE.toString().equals(key.toLowerCase())){ 47 | if(value.indexOf(";")>0){ 48 | response.setMimeType(value.substring(0,value.indexOf(";"))); 49 | }else { 50 | response.setMimeType(value); 51 | } 52 | } 53 | }); 54 | response.setStatus(status); 55 | } 56 | 57 | @Override 58 | public boolean readResponse(byte@NotNull[] data_out, int bytes_to_read, IntRef bytes_read, CefCallback callback) { 59 | try { 60 | int availableSize = myInputStream.available(); 61 | if (availableSize > 0) { 62 | int bytesToRead = Math.min(bytes_to_read, availableSize); 63 | bytesToRead = myInputStream.read(data_out, 0, bytesToRead); 64 | bytes_read.set(bytesToRead); 65 | return true; 66 | } 67 | } 68 | catch (IOException e) { 69 | LOG.error(e); 70 | } 71 | bytes_read.set(0); 72 | try { 73 | myInputStream.close(); 74 | } 75 | catch (IOException e) { 76 | LOG.error(e); 77 | } 78 | return false; 79 | } 80 | } -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/enclose.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function a(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=5)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=MathJax._.components.global.isObject,t.combineConfig=MathJax._.components.global.combineConfig,t.combineDefaults=MathJax._.components.global.combineDefaults,t.combineWithMathJax=MathJax._.components.global.combineWithMathJax,t.MathJax=MathJax._.components.global.MathJax},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncloseConfiguration=t.EncloseMethods=t.ENCLOSE_OPTIONS=void 0;var n=a(2),o=a(3),r=a(4);t.ENCLOSE_OPTIONS={"data-arrowhead":1,color:1,mathcolor:1,background:1,mathbackground:1,"data-padding":1,"data-thickness":1},t.EncloseMethods={},t.EncloseMethods.Enclose=function(e,a){var n=e.GetArgument(a).replace(/,/g," "),o=e.GetBrackets(a,""),i=e.ParseArg(a),u=r.default.keyvalOptions(o,t.ENCLOSE_OPTIONS);u.notation=n,e.Push(e.create("node","menclose",[i],u))},new o.CommandMap("enclose",{enclose:"Enclose"},t.EncloseMethods),t.EncloseConfiguration=n.Configuration.create("enclose",{handler:{macro:["enclose"]}})},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.ParseUtil.default},function(e,t,a){"use strict";a.r(t);var n=a(0),o=a(1);Object(n.combineWithMathJax)({_:{input:{tex:{enclose:{EncloseConfiguration:o}}}}})}]); -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/colorV2.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function o(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=e,o.d=function(t,e,a){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(a,n,function(e){return t[e]}.bind(null,n));return a},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=4)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.components.global.isObject,e.combineConfig=MathJax._.components.global.combineConfig,e.combineDefaults=MathJax._.components.global.combineDefaults,e.combineWithMathJax=MathJax._.components.global.combineWithMathJax,e.MathJax=MathJax._.components.global.MathJax},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConfiguration=e.ColorV2Methods=void 0;var a=o(2),n=o(3);e.ColorV2Methods={Color:function(t,e){var o=t.GetArgument(e),a=t.stack.env.color;t.stack.env.color=o;var n=t.ParseArg(e);a?t.stack.env.color=a:delete t.stack.env.color;var r=t.create("node","mstyle",[n],{mathcolor:o});t.Push(r)}},new a.CommandMap("colorv2",{color:"Color"},e.ColorV2Methods),e.ColorConfiguration=n.Configuration.create("colorv2",{handler:{macro:["colorv2"]}})},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},function(t,e,o){"use strict";o.r(e);var a=o(0),n=o(1);Object(a.combineWithMathJax)({_:{input:{tex:{colorv2:{ColorV2Configuration:n}}}}}),function(t,e,o){var n,r,i,c=MathJax.config.tex;if(c&&c.packages){var l=c.packages,u=l.indexOf(t);u>=0&&(l[u]=e),o&&c[t]&&(Object(a.combineConfig)(c,(n={},r=e,i=c[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n)),delete c[t])}}("colorV2","colorv2",!1)}]); -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/css/content-theme/light.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vditor - A markdown editor written in TypeScript. 3 | * 4 | * MIT License 5 | * 6 | * Copyright (c) 2018-present B3log 开源, b3log.org 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in all 16 | * copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | * SOFTWARE. 25 | * 26 | */ 27 | .vditor-reset h1, .vditor-reset h2 { 28 | padding-bottom: 0.3em; 29 | border-bottom: 1px solid #eaecef; 30 | } 31 | 32 | .vditor-reset hr { 33 | background-color: #eaecef; 34 | } 35 | 36 | .vditor-reset blockquote { 37 | color: #6a737d; 38 | border-left: .25em solid #eaecef 39 | } 40 | 41 | .vditor-reset iframe { 42 | border: 1px solid #d1d5da 43 | } 44 | 45 | .vditor-reset table tr { 46 | border-top: 1px solid #c6cbd1; 47 | background-color: #fafbfc 48 | } 49 | 50 | .vditor-reset table td, .vditor-reset table th { 51 | border: 1px solid #dfe2e5 52 | } 53 | 54 | .vditor-reset table tbody tr:nth-child(2n) { 55 | background-color: #fff 56 | } 57 | 58 | .vditor-reset code:not(.hljs):not(.highlight-chroma) { 59 | background-color: rgba(27, 31, 35, .05); 60 | } 61 | 62 | .vditor-reset kbd { 63 | color: #24292e; 64 | background-color: #fafbfc; 65 | border: solid 1px #d1d5da; 66 | box-shadow: inset 0 -1px 0 #d1d5da; 67 | } 68 | 69 | .vditor-speech { 70 | background-color: #f6f8fa; 71 | border: 1px solid #d1d5da; 72 | color: #586069; 73 | } 74 | 75 | .vditor-speech--current, .vditor-speech:hover { 76 | color: #4285f4; 77 | } 78 | 79 | .vditor-linkcard a { 80 | background-color: #f6f8fa; 81 | } 82 | 83 | .vditor-linkcard a:visited .vditor-linkcard__abstract { 84 | color: rgba(88, 96, 105, 0.36); 85 | } 86 | 87 | .vditor-linkcard__title { 88 | color: #24292e; 89 | } 90 | 91 | .vditor-linkcard__abstract { 92 | color: #586069; 93 | } 94 | 95 | .vditor-linkcard__site { 96 | color: #4285f4; 97 | } 98 | 99 | .vditor-linkcard__image { 100 | background-color: rgba(88, 96, 105, 0.36); 101 | } 102 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/css/content-theme/idea-light.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vditor - A markdown editor written in TypeScript. 3 | * 4 | * MIT License 5 | * 6 | * Copyright (c) 2018-present B3log 开源, b3log.org 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in all 16 | * copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | * SOFTWARE. 25 | * 26 | */ 27 | .vditor-reset h1, .vditor-reset h2 { 28 | padding-bottom: 0.3em; 29 | border-bottom: 1px solid #eaecef; 30 | } 31 | 32 | .vditor-reset hr { 33 | background-color: #eaecef; 34 | } 35 | 36 | .vditor-reset blockquote { 37 | color: #6a737d; 38 | border-left: .25em solid #eaecef 39 | } 40 | 41 | .vditor-reset iframe { 42 | border: 1px solid #d1d5da 43 | } 44 | 45 | .vditor-reset table tr { 46 | border-top: 1px solid #c6cbd1; 47 | background-color: #fafbfc 48 | } 49 | 50 | .vditor-reset table td, .vditor-reset table th { 51 | border: 1px solid #dfe2e5 52 | } 53 | 54 | .vditor-reset table tbody tr:nth-child(2n) { 55 | background-color: #fff 56 | } 57 | 58 | .vditor-reset code:not(.hljs):not(.highlight-chroma) { 59 | background-color: rgba(27, 31, 35, .05); 60 | } 61 | 62 | .vditor-reset kbd { 63 | color: #24292e; 64 | background-color: #fafbfc; 65 | border: solid 1px #d1d5da; 66 | box-shadow: inset 0 -1px 0 #d1d5da; 67 | } 68 | 69 | .vditor-speech { 70 | background-color: #f6f8fa; 71 | border: 1px solid #d1d5da; 72 | color: #586069; 73 | } 74 | 75 | .vditor-speech--current, .vditor-speech:hover { 76 | color: #4285f4; 77 | } 78 | 79 | .vditor-linkcard a { 80 | background-color: #f6f8fa; 81 | } 82 | 83 | .vditor-linkcard a:visited .vditor-linkcard__abstract { 84 | color: rgba(88, 96, 105, 0.36); 85 | } 86 | 87 | .vditor-linkcard__title { 88 | color: #24292e; 89 | } 90 | 91 | .vditor-linkcard__abstract { 92 | color: #586069; 93 | } 94 | 95 | .vditor-linkcard__site { 96 | color: #4285f4; 97 | } 98 | 99 | .vditor-linkcard__image { 100 | background-color: rgba(88, 96, 105, 0.36); 101 | } 102 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/markmap/prism.css: -------------------------------------------------------------------------------- 1 | /** 2 | * prism.js default theme for JavaScript, CSS and HTML 3 | * Based on dabblet (http://dabblet.com) 4 | * @author Lea Verou 5 | */ 6 | 7 | code[class*="language-"], 8 | pre[class*="language-"] { 9 | color: black; 10 | background: none; 11 | text-shadow: 0 1px white; 12 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 13 | font-size: 1em; 14 | text-align: left; 15 | white-space: pre; 16 | word-spacing: normal; 17 | word-break: normal; 18 | word-wrap: normal; 19 | line-height: 1.5; 20 | 21 | -moz-tab-size: 4; 22 | -o-tab-size: 4; 23 | tab-size: 4; 24 | 25 | -webkit-hyphens: none; 26 | -moz-hyphens: none; 27 | -ms-hyphens: none; 28 | hyphens: none; 29 | } 30 | 31 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, 32 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { 33 | text-shadow: none; 34 | background: #b3d4fc; 35 | } 36 | 37 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection, 38 | code[class*="language-"]::selection, code[class*="language-"] ::selection { 39 | text-shadow: none; 40 | background: #b3d4fc; 41 | } 42 | 43 | @media print { 44 | code[class*="language-"], 45 | pre[class*="language-"] { 46 | text-shadow: none; 47 | } 48 | } 49 | 50 | /* Code blocks */ 51 | pre[class*="language-"] { 52 | padding: 1em; 53 | margin: .5em 0; 54 | overflow: auto; 55 | } 56 | 57 | :not(pre) > code[class*="language-"], 58 | pre[class*="language-"] { 59 | background: #f5f2f0; 60 | } 61 | 62 | /* Inline code */ 63 | :not(pre) > code[class*="language-"] { 64 | padding: .1em; 65 | border-radius: .3em; 66 | white-space: normal; 67 | } 68 | 69 | .token.comment, 70 | .token.prolog, 71 | .token.doctype, 72 | .token.cdata { 73 | color: slategray; 74 | } 75 | 76 | .token.punctuation { 77 | color: #999; 78 | } 79 | 80 | .token.namespace { 81 | opacity: .7; 82 | } 83 | 84 | .token.property, 85 | .token.tag, 86 | .token.boolean, 87 | .token.number, 88 | .token.constant, 89 | .token.symbol, 90 | .token.deleted { 91 | color: #905; 92 | } 93 | 94 | .token.selector, 95 | .token.attr-name, 96 | .token.string, 97 | .token.char, 98 | .token.builtin, 99 | .token.inserted { 100 | color: #690; 101 | } 102 | 103 | .token.operator, 104 | .token.entity, 105 | .token.url, 106 | .language-css .token.string, 107 | .style .token.string { 108 | color: #9a6e3a; 109 | /* This background color was intended by the author of this theme. */ 110 | background: hsla(0, 0%, 100%, .5); 111 | } 112 | 113 | .token.atrule, 114 | .token.attr-value, 115 | .token.keyword { 116 | color: #07a; 117 | } 118 | 119 | .token.function, 120 | .token.class-name { 121 | color: #DD4A68; 122 | } 123 | 124 | .token.regex, 125 | .token.important, 126 | .token.variable { 127 | color: #e90; 128 | } 129 | 130 | .token.important, 131 | .token.bold { 132 | font-weight: bold; 133 | } 134 | .token.italic { 135 | font-style: italic; 136 | } 137 | 138 | .token.entity { 139 | cursor: help; 140 | } 141 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/verb.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function n(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.components.global.isObject,e.combineConfig=MathJax._.components.global.combineConfig,e.combineDefaults=MathJax._.components.global.combineDefaults,e.combineWithMathJax=MathJax._.components.global.combineWithMathJax,e.MathJax=MathJax._.components.global.MathJax},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerbConfiguration=e.VerbMethods=void 0;var a=n(2),r=n(3),o=n(4),i=n(5);e.VerbMethods={},e.VerbMethods.Verb=function(t,e){var n=t.GetNext(),a=++t.i;if(""===n)throw new i.default("MissingArgFor","Missing argument for %1",e);for(;t.i 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
68 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/html.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function a(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=6)}([function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(5),r={Href:function(t,e){var a=t.GetArgument(e),r=o(t,e);n.default.setAttribute(r,"href",a),t.Push(r)},Class:function(t,e){var a=t.GetArgument(e),r=o(t,e),u=n.default.getAttribute(r,"class");u&&(a=u+" "+a),n.default.setAttribute(r,"class",a),t.Push(r)},Style:function(t,e){var a=t.GetArgument(e),r=o(t,e),u=n.default.getAttribute(r,"style");u&&(";"!==a.charAt(a.length-1)&&(a+=";"),a=u+" "+a),n.default.setAttribute(r,"style",a),t.Push(r)},Id:function(t,e){var a=t.GetArgument(e),r=o(t,e);n.default.setAttribute(r,"id",a),t.Push(r)}},o=function(t,e){var a=t.ParseArg(e);if(!n.default.isInferred(a))return a;var r=n.default.getChildren(a);if(1===r.length)return r[0];var o=t.create("node","mrow");return n.default.copyChildren(a,o),n.default.copyAttributes(a,o),o};e.default=r},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.components.global.isObject,e.combineConfig=MathJax._.components.global.combineConfig,e.combineDefaults=MathJax._.components.global.combineDefaults,e.combineWithMathJax=MathJax._.components.global.combineWithMathJax,e.MathJax=MathJax._.components.global.MathJax},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HtmlConfiguration=void 0;var n=a(3),r=a(4),o=a(0);new r.CommandMap("html_macros",{href:"Href",class:"Class",style:"Style",cssId:"Id"},o.default),e.HtmlConfiguration=n.Configuration.create("html",{handler:{macro:["html_macros"]}})},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.NodeUtil.default},function(t,e,a){"use strict";a.r(e);var n=a(1),r=a(2),o=a(0);Object(n.combineWithMathJax)({_:{input:{tex:{html:{HtmlConfiguration:r,HtmlMethods:o}}}}})}]); -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/css/content-theme/dark.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vditor - A markdown editor written in TypeScript. 3 | * 4 | * MIT License 5 | * 6 | * Copyright (c) 2018-present B3log 开源, b3log.org 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in all 16 | * copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | * SOFTWARE. 25 | * 26 | */ 27 | .vditor-reset { 28 | color: #d1d5da; 29 | } 30 | 31 | .vditor-reset a, .vditor-ir__link { 32 | color: #4285f4; 33 | } 34 | 35 | .vditor-reset h1, .vditor-reset h2 { 36 | padding-bottom: 0.3em; 37 | border-bottom: 1px solid #d1d5da 38 | } 39 | 40 | .vditor-reset hr { 41 | background-color: #d1d5da 42 | } 43 | 44 | .vditor-reset blockquote { 45 | padding: 0 1em; 46 | color: #b9b9b9; 47 | border-left: .25em solid #d1d5da 48 | } 49 | 50 | .vditor-reset iframe { 51 | border: 1px solid #141414 52 | } 53 | 54 | .vditor-reset table tr { 55 | background-color: #2f363d 56 | } 57 | 58 | .vditor-reset table td, .vditor-reset table th { 59 | border: 1px solid #dfe2e5 60 | } 61 | 62 | .vditor-reset table tbody tr:nth-child(2n) { 63 | background-color: #24292e 64 | } 65 | 66 | .vditor-reset code:not(.hljs):not(.highlight-chroma) { 67 | background-color: rgba(66, 133, 244, .36); 68 | } 69 | 70 | .vditor-reset .language-abc svg, 71 | .vditor-reset .language-abc path { 72 | fill: currentColor; 73 | color: #d1d5da; 74 | } 75 | 76 | .language-graphviz polygon { 77 | fill: rgba(66, 133, 244, .36); 78 | } 79 | 80 | .vditor-reset kbd { 81 | color: #d1d5da; 82 | background-color: #2f363d; 83 | border: 1px solid #141414; 84 | box-shadow: inset 0 -1px 0 #141414 85 | } 86 | 87 | .vditor-copy svg { 88 | color: #b9b9b9 89 | } 90 | 91 | .vditor-speech { 92 | background-color: #1d2125; 93 | border: 1px solid #141414; 94 | color: #b9b9b9 95 | } 96 | 97 | .vditor-speech--current, .vditor-speech:hover { 98 | color: #fff 99 | } 100 | 101 | .vditor-linkcard a { 102 | background-color: #1d2125; 103 | } 104 | 105 | .vditor-linkcard a:visited .vditor-linkcard__abstract { 106 | color: hsla(0, 0%, 72.5%, .36) 107 | } 108 | 109 | .vditor-linkcard__title { 110 | color: #d1d5da 111 | } 112 | 113 | .vditor-linkcard__abstract { 114 | color: #b9b9b9 115 | } 116 | 117 | .vditor-linkcard__site { 118 | color: #fff 119 | } 120 | 121 | .vditor-linkcard__image { 122 | background-color: hsla(0, 0%, 72.5%, .36) 123 | } 124 | -------------------------------------------------------------------------------- /src/main/resources/vditor/dist/js/mathjax/input/tex/extensions/bbox.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function a(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=e,a.d=function(t,e,o){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(o,n,function(e){return t[e]}.bind(null,n));return o},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=5)}([function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.components.global.isObject,e.combineConfig=MathJax._.components.global.combineConfig,e.combineDefaults=MathJax._.components.global.combineDefaults,e.combineWithMathJax=MathJax._.components.global.combineWithMathJax,e.MathJax=MathJax._.components.global.MathJax},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BboxConfiguration=e.BboxMethods=void 0;var o=a(2),n=a(3),i=a(4);e.BboxMethods={},e.BboxMethods.BBox=function(t,e){for(var a,o,n,l=t.GetBrackets(e,""),c=t.ParseArg(e),p=l.split(/,/),f=0,s=p.length;f 2 | export declare const fixGSKeyBackspace: (event: KeyboardEvent, vditor: IVditor, startContainer: Node) => boolean; 3 | export declare const fixCJKPosition: (range: Range, vditor: IVditor, event: KeyboardEvent) => void; 4 | export declare const fixCursorDownInlineMath: (range: Range, key: string) => void; 5 | export declare const insertEmptyBlock: (vditor: IVditor, position: InsertPosition) => void; 6 | export declare const isFirstCell: (cellElement: HTMLElement) => false | HTMLTableElement; 7 | export declare const isLastCell: (cellElement: HTMLElement) => false | HTMLTableElement; 8 | export declare const insertAfterBlock: (vditor: IVditor, event: KeyboardEvent, range: Range, element: HTMLElement, blockElement: HTMLElement) => boolean; 9 | export declare const insertBeforeBlock: (vditor: IVditor, event: KeyboardEvent, range: Range, element: HTMLElement, blockElement: HTMLElement) => boolean; 10 | export declare const listToggle: (vditor: IVditor, range: Range, type: string, cancel?: boolean) => void; 11 | export declare const listIndent: (vditor: IVditor, liElement: HTMLElement, range: Range) => void; 12 | export declare const listOutdent: (vditor: IVditor, liElement: HTMLElement, range: Range, topListElement: HTMLElement) => void; 13 | export declare const setTableAlign: (tableElement: HTMLTableElement, type: string) => void; 14 | export declare const isHrMD: (text: string) => boolean; 15 | export declare const isHeadingMD: (text: string) => boolean; 16 | export declare const execAfterRender: (vditor: IVditor, options?: { 17 | enableAddUndoStack: boolean; 18 | enableHint: boolean; 19 | enableInput: boolean; 20 | }) => void; 21 | export declare const fixList: (range: Range, vditor: IVditor, pElement: HTMLElement | false, event: KeyboardEvent) => boolean; 22 | export declare const fixTab: (vditor: IVditor, range: Range, event: KeyboardEvent) => boolean; 23 | export declare const fixMarkdown: (event: KeyboardEvent, vditor: IVditor, pElement: HTMLElement | false, range: Range) => boolean; 24 | export declare const insertRow: (vditor: IVditor, range: Range, cellElement: HTMLElement) => void; 25 | export declare const insertRowAbove: (vditor: IVditor, range: Range, cellElement: HTMLElement) => void; 26 | export declare const insertColumn: (vditor: IVditor, tableElement: HTMLTableElement, cellElement: HTMLElement, type?: InsertPosition) => void; 27 | export declare const deleteRow: (vditor: IVditor, range: Range, cellElement: HTMLElement) => void; 28 | export declare const deleteColumn: (vditor: IVditor, range: Range, tableElement: HTMLTableElement, cellElement: HTMLElement) => void; 29 | export declare const fixTable: (vditor: IVditor, event: KeyboardEvent, range: Range) => boolean; 30 | export declare const fixCodeBlock: (vditor: IVditor, event: KeyboardEvent, codeRenderElement: HTMLElement, range: Range) => boolean; 31 | export declare const fixBlockquote: (vditor: IVditor, range: Range, event: KeyboardEvent, pElement: HTMLElement | false) => boolean; 32 | export declare const fixTask: (vditor: IVditor, range: Range, event: KeyboardEvent) => boolean; 33 | export declare const fixDelete: (vditor: IVditor, range: Range, event: KeyboardEvent, pElement: HTMLElement | false) => boolean; 34 | export declare const fixHR: (range: Range) => void; 35 | export declare const fixFirefoxArrowUpTable: (event: KeyboardEvent, blockElement: false | HTMLElement, range: Range) => boolean; 36 | export declare const paste: (vditor: IVditor, event: (ClipboardEvent | DragEvent) & { 37 | target: HTMLElement; 38 | }, callback: { 39 | pasteCode(code: string): void; 40 | }) => Promise; 41 | -------------------------------------------------------------------------------- /src/main/java/com/shuzijun/markdown/ui/PdfDialogWrapper.java: -------------------------------------------------------------------------------- 1 | package com.shuzijun.markdown.ui; 2 | 3 | import com.intellij.notification.Notification; 4 | import com.intellij.notification.NotificationType; 5 | import com.intellij.notification.Notifications; 6 | import com.intellij.openapi.application.ApplicationManager; 7 | import com.intellij.openapi.project.Project; 8 | import com.intellij.openapi.ui.DialogWrapper; 9 | import com.intellij.ui.components.JBPanel; 10 | import com.intellij.ui.components.JBScrollPane; 11 | import com.intellij.ui.jcef.JCEFHtmlPanel; 12 | import com.shuzijun.markdown.editor.MarkdownHtmlPanel; 13 | import com.shuzijun.markdown.model.PluginConstant; 14 | import com.shuzijun.markdown.util.FileUtils; 15 | import org.cef.misc.CefPdfPrintSettings; 16 | import org.jetbrains.annotations.NotNull; 17 | import org.jetbrains.annotations.Nullable; 18 | 19 | import javax.swing.*; 20 | import java.awt.*; 21 | import java.awt.event.ActionEvent; 22 | 23 | /** 24 | * @author shuzijun 25 | */ 26 | public class PdfDialogWrapper extends DialogWrapper { 27 | 28 | private JPanel jpanel; 29 | private MarkdownHtmlPanel loginJCEFPanel; 30 | private String fileName; 31 | private String message = ""; 32 | private Project project; 33 | 34 | public PdfDialogWrapper(@Nullable Project project, String sourceUrl, String html, String fileName) { 35 | super(project, true); 36 | this.project = project; 37 | this.fileName = fileName; 38 | jpanel = new JBPanel(); 39 | jpanel.setLayout(new BorderLayout()); 40 | loginJCEFPanel = new MarkdownHtmlPanel(sourceUrl, project, false); 41 | loginJCEFPanel.getComponent().setMinimumSize(new Dimension(1000, 500)); 42 | loginJCEFPanel.getComponent().setPreferredSize(new Dimension(1000, 500)); 43 | loginJCEFPanel.loadMyHTML(html, sourceUrl); 44 | jpanel.add(new JBScrollPane(loginJCEFPanel.getComponent(), JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER); 45 | jpanel.repaint(); 46 | setModal(false); 47 | init(); 48 | setTitle("Preview PDF"); 49 | } 50 | 51 | @Nullable 52 | @Override 53 | protected JComponent createCenterPanel() { 54 | return jpanel; 55 | } 56 | 57 | @Override 58 | protected @NotNull Action getOKAction() { 59 | Action action = new OkAction() { 60 | @Override 61 | protected void doAction(ActionEvent e) { 62 | printPdf(fileName); 63 | } 64 | }; 65 | action.putValue(Action.NAME, "Export"); 66 | return action; 67 | } 68 | 69 | private void printPdf(String fileName) { 70 | loginJCEFPanel.getCefBrowser().printToPDF(fileName, new CefPdfPrintSettings(), (targetString, success) -> { 71 | if (success) { 72 | Notifications.Bus.notify(new Notification(PluginConstant.NOTIFICATION_GROUP, "Export PDF", "Export success:" + fileName, NotificationType.INFORMATION), project); 73 | FileUtils.refreshProjectDirectory(project, fileName); 74 | } else { 75 | Notifications.Bus.notify(new Notification(PluginConstant.NOTIFICATION_GROUP, "Export PDF", "Export failure", NotificationType.INFORMATION), project); 76 | } 77 | ApplicationManager.getApplication().invokeLater(() -> getCancelAction().actionPerformed(null)); 78 | }); 79 | } 80 | 81 | @Override 82 | protected void dispose() { 83 | loginJCEFPanel.dispose(); 84 | super.dispose(); 85 | } 86 | 87 | public String getMessage() { 88 | return message; 89 | } 90 | } 91 | 92 | --------------------------------------------------------------------------------