Problem linking to local files in the same folder in exported HTML

dgmags's Avatar


17 Apr, 2019 04:14 AM

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

I have a Markdown file in which I am trying to link to other files in the same folder. I use relative links in the reference (e.g. [1]: ./MyFile.pdf)

  • If I open the file in Marked2, the links work.

  • If I export the file to HTML (in the same folder), the links no longer work.

  • If I instead copy the HTML source using Shift-Cmd-C, save that text to an HTML file, and open it in a browser, the links work (but the text is not styled).

  • When I open the styled HTML file and use Copy link over one of the non-working links, the pasted path is missing the lowest level of folder. In other words, it's as if the reference were [1]: ../MyFile.pdf rather than [1]: ./MyFile.pdf.

Is this a bug or am I missing something?

Also, a second issue: using the keystroke Shift-Cmd-E brings up the export panel at the bottom of the window; however, using the (supposedly equivalent) Export… menu selection under the File menu does nothing.

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

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

// Configuration (do not edit) Marked 2 972 (Direct)

macOS Version: 10.14.4

allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: YES
convertGithubCheckboxes: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 3
defaultProcessor: MultiMarkdown
enableMiniMap: YES
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: NO
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: NO
includeKatex: NO
limitTextWidth: NO
minimalJavaScript: NO
permissionGranted: NO
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopRight: %date p. %page
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: YES
shouldLoadCritic: NO
syntaxHighlight: NO
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
useCustomPreprocessor: NO
useFirstH1AsPrintTitle: YES

  1. Support Staff 1 Posted by Brett on 17 Apr, 2019 04:46 PM

    Brett's Avatar

    I'm not able to replicate this using the information provided. Could you create an example and attach both the source markdown and the exported HTML versions? Every version I've tested so far has included the correct path in the HTML output. Thanks!

  2. Support Staff 2 Posted by Brett on 17 Apr, 2019 05:00 PM

    Brett's Avatar

    Regarding the Export... menu item, tracked that bug down and fixed for next update. Thanks for reporting.

  3. 3 Posted by dgmags on 17 Apr, 2019 08:18 PM

    dgmags's Avatar

    Hello Brett...

    Thanks for your response. I've attached the files as requested.

    (b) _about_Reference_SaveAsHTML.html
    (c) _about_Reference_CopyHTMLSource.html

    The Markdown file references two pdfs in the same folder

       - EN-05-10070.pdf
       - InnovativeSocialSecurityNov2012.pdf

    I've attached dummy versions of these to save space.

       1. When I open (a) in Marked 2 and click on the link (the reference
       number), Marked 2 presents a dialog asking if I want to open the file in
       Preview, and if I accept, the file is opened.
       2. (b) results from the *Save as HTML* command, and is saved to the same
       folder. When I open the HTML in a browser and click the link, nothing
       happens. I happen to use Github style, but changing styles didn't correct
       3. (c) results from using the *Copy HTML Source* command, pasting to a
       text editor, and saving. When this is opened in a browser, the link works
       and the pdf is opened in the browser window.
       4. If I open (b), hover over the first link, and use *Copy Link*, the
       result is
       5. If I open (c) and do the same thing, the result is

    So it seems that the link in (b) omits the immediate folder (*Social
    Security*) from the path. The link doesn't work because it points to the
    wrong folder.

    Hope this provides enough to figure what's going on.



    David Magnuson

  4. Support Staff 4 Posted by Brett on 17 Apr, 2019 08:50 PM

    Brett's Avatar

    So the hrefs in the links are the same in both HTML documents. The difference is that the styled one has a <base> tag that's likely the culprit. I don't think I even meant for that tag to be included, I'll look into that. To confirm, try the attached file saved to the same folder and see if the links work properly (same file, just removed that base tag).

  5. 5 Posted by MrC on 18 Apr, 2019 12:12 AM

    MrC's Avatar

    I just discovered the same bug. This one really startled me, as when I clicked a link, the browser opened a directory listing where the HTML resides! It was a real WTH moment!

    Removing the < base > tag from the generated HTML file resolves the issue.

  6. 6 Posted by dgmags on 18 Apr, 2019 01:21 AM

    dgmags's Avatar

    Yup, the fixed file works fine.

    Glad you were able to track it down. Until it's fixed, I can just edit-out
    the offending *<base* tag.



    David Magnuson

  7. Support Staff 7 Posted by Brett on 18 Apr, 2019 11:53 AM

    Brett's Avatar

    Thanks for checking, I have this fixed for the next update.


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


? 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