Marked 2 not displaying local images
I have a Markdown document with an image in a subdirectory that is a child of the directory the Markdown document is in. I tried using the following Markdown:
but the image did not display. Wondering if it was an HTML issue, I entered the following HTML:
but still no image displayed. I loaded the file into another Markdown previewer and the image displayed as I had expected.
// Please enter a list of steps required to reproduce the issue // Steps to reproduce:
- Create Markdown file with an image link
// If applicable please attach a sample document that causes the issue for you.
// Configuration (do not edit) Marked 2 1014 (Direct)
macOS Version: 11.2
additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: YES
summaryMdIsGitBook: YES
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: NO
convertGithubCheckboxes: YES
convertGithubEmoji: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 3
defaultProcessor: Discount (GFM)
enableMiniMap: NO
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: txt, md, mdown, html, markdown
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: YES
includeKatex: NO
limitTextWidth: NO
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: YES
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft:
printHeaderTopRight:
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: NO
shouldLoadCritic: NO
syntaxHighlight: NO
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES
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
Support Staff 1 Posted by Brett on 08 Feb, 2021 10:05 PM
Could you provide a zip file containing a subfolder with image, and the markdown file that should be loading it? Verify that this is happening in the test file, then zip it and attach it here.
Normally I would assume this was a sandboxing issue, but you're on the direct version which doesn't have permissions issues. So I'll need to see a sample to be able to replicate the issue.
Thanks!
Brett
2 Posted by Charles McKnigh... on 09 Feb, 2021 03:44 AM
I’ve been doing some digging and what appears to be happening is that if I drop the directory with all of my Markdown files in it, Markdown seems to reference everything as if that folder was the root because when I load the file individually, I don’t have the issue. I saw a similar issue on the support site, so I suspect the Markdown parser is looking for the image in the root.
To duplicate:
1. Create a directory with a subdirectory.
2. Create an image directory within the subdirectory.
3. Drop an image in the image directory.
4. In the parent directory of the image directory, create a Markdown file with an image tag (Markdown or HTML, doesn’t matter).
5. Drop the parent folder of the Markdown document on to a Marked 2 shortcut.
The image does not appear.
If you just open the Markdown file directly, the image will appear.
Ergo sum, I would suggest checking to see how the paths are being fed to the Markdown processor. At least that’s where I’d start.
Hope this helps!
Chuck
P.S. In case I did a poor job explaining the directory structure, it looks something like:
markedtest
+— doc
+— img
clown.jpeg