IMG link does not respect a space within the path

Mat Chavez's Avatar

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

additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: NO
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
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft:
printHeaderTopRight:
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: YES
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

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

    Brett's Avatar

    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. 2 Posted by Mat Chavez on 16 Jan, 2020 11:44 PM

    Mat Chavez's Avatar

    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 3 Posted by Brett on 17 Jan, 2020 01:58 AM

    Brett's Avatar

    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. 4 Posted by Mat on 19 Jan, 2020 11:21 PM

    Mat's Avatar

    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 5 Posted by Brett on 20 Jan, 2020 04:09 PM

    Brett's Avatar

    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

Reply to this discussion

Internal reply

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

Attaching KB article:

»

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
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac