From 47f1e4f892b36b8171f043a9dc5d73a0efe9fef2 Mon Sep 17 00:00:00 2001 From: Zignature Date: Sat, 15 Jan 2022 23:56:27 +0100 Subject: [PATCH] Updated readme and easymde.d.ts to reflect escapePrompURLs option --- README.md | 2 ++ types/easymde.d.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f47da4c..fa0b07a 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,7 @@ easyMDE.value('New input for **EasyMDE**'); - **previewClass**: A string or array of strings that will be applied to the preview screen when activated. Defaults to `"editor-preview"`. - **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews. - **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`. +- **escapePromptURLs**: If set to `true`, urlencodes and escapes links entered via the JS prompt to prevent malformed Markdown rendered links. Only works when `promptURLs` is set to `true`. Defaults to `false`. - **promptTexts**: Customize the text used to prompt for URLs. - **image**: The text to use when prompting for an image's URL. Defaults to `URL of the image:`. - **link**: The text to use when prompting for a link's URL. Defaults to `URL for the link:`. @@ -276,6 +277,7 @@ const editor = new EasyMDE({ return "Loading..."; }, promptURLs: true, + escapePromptURLs: true, promptTexts: { image: "Custom prompt for URL:", link: "Custom prompt for URL:", diff --git a/types/easymde.d.ts b/types/easymde.d.ts index b082324..12ba258 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -197,7 +197,7 @@ declare namespace EasyMDE { previewImagesInEditor?: boolean; previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; promptURLs?: boolean; - escapeURLs?: boolean; + escapePromptURLs?: boolean; renderingConfig?: RenderingOptions; shortcuts?: Shortcuts; showIcons?: ReadonlyArray;