IMG link does not respect a space within the path

Mat Chavez

16 Jan, 2020 10:53 PM

// Please enter a detailed description of the issue // Description of the issue:

When an image is linked locally, in my case from the Desktop/dir with space, a space char in the directory is not respected in Marked2.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

1. Create folder that has a space in its name
2. Add an image to the directory
3. Create a .md that references the image
4. Observe that the image is broken in Marked2, where other applications don't have this issue.

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 978 (Mac App Store)

macOS Version: 10.15.2

allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
convertGithubCheckboxes: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 3
defaultProcessor: Discount (GFM)
enableMiniMap: NO
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: YES
includeKatex: NO
limitTextWidth: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: NO
printFooterFirstPage: NO
processHTMLFiles: YES
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: YES
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

1. Support Staff Posted by Brett on 16 Jan, 2020 11:19 PM

Other applications may be correcting the issue for you, but it’s still incorrect to have a space in a url. Replace the space with %20.

- Brett

2. Posted by Mat Chavez on 16 Jan, 2020 11:44 PM

I understand you aren't going to correct it, but it's also fair to say it's a local path, and local paths are legal for a space.

Maybe it's now a feature request, but I think if you have to "correct" for it through a URI interpreting a space as a %20, that's something that should be added.

Thanks.

3. Support Staff Posted by Brett on 17 Jan, 2020 01:58 AM

Spaces are legal in a path, but not in a url, which is what markdown is expecting. Correcting for that automatically is great if you have full control over what’s legit markup for your users, but because Marked works with multiple processors, it’s not a given that you’d be solving more problems than you’d cause.

For example, MMD allows a title attribute after the url, separated by a space. If I start converting everything inside of the parens, I’ve broken every link that used that syntax.

- Brett

4. Posted by Mat on 19 Jan, 2020 11:21 PM

Fair enough. It's a balance of considerations, I'm sure. I hope that at some point this becomes solvable, in a way that handles all your needs. It was still jarring having used a "drag and drop" method.

Would you consider that the other app should be subbing a %20 because the path is still technically a URL?

5. Support Staff Posted by Brett on 20 Jan, 2020 04:09 PM

Not necessarily, it depends on the Markdown processor it's using. While
I don't know of any that would be broken by using %20 instead of space,
I can't guarantee that's true across the board.

-Brett

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help Blurs the current field

Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

 01 Mar, 2021 02:00 PM Rendering Mermaid 01 Mar, 2021 01:56 PM Source Line Numbers 26 Feb, 2021 02:24 PM *manual* refresh needed when using mathjax from script 24 Feb, 2021 06:25 AM pdflatex not found 23 Feb, 2021 06:39 PM streaming preview beachballs when URL is supplied

Recent Articles

 Intra-document links in exported PDFs Using Ulysses with Marked Fenced code blocks inside indented code blocks Using JavaScript in Marked Custom CSS: Writing custom CSS for Marked