tag:support.markedapp.com,2011-09-11:/discussions/problems/152471-problem-linking-to-local-files-in-the-same-folder-in-exported-htmlMarked: Discussion 2020-09-16T21:46:20Ztag:support.markedapp.com,2011-09-11:Comment/471839722019-04-17T04:14:29Z2020-09-16T21:46:19ZProblem linking to local files in the same folder in exported HTML<div><p>// Please enter a detailed description of the issue // Description of the issue:</p>
<p>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. <code>[1]: ./MyFile.pdf</code>)</p>
<ul>
<li>
<p>If I open the file in <em>Marked2</em>, the links work.</p>
</li>
<li>
<p>If I export the file to HTML (in the same folder), the links no longer work.</p>
</li>
<li>
<p>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).</p>
</li>
<li>
<p>When I open the styled HTML file and use <em>Copy link</em> 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 <code>[1]: ../MyFile.pdf</code> rather than <code>[1]: ./MyFile.pdf</code>.</p>
</li>
</ul>
<p>Is this a bug or am I missing something?</p>
<p>Also, a second issue: using the keystroke <em>Shift-Cmd-E</em> brings up the export panel at the bottom of the window; however, using the (supposedly equivalent) <em>Export…</em> menu selection under the <em>File</em> menu does nothing.</p>
<p>// Please enter a list of steps required to reproduce the issue // Steps to reproduce:</p>
<p>// If applicable please attach a sample document that causes the issue for you.</p>
<p>// Configuration (do not edit) Marked 2 972 (Direct)</p>
<h2><a name="macos-version-10-14-4-" class="anchor" href="#macos-version-10-14-4-"></a>macOS Version: 10.14.4</h2>
<p>additionalMathJaxConfig:<br>
allowPageBreakInCode: YES<br>
bookTxtIsLeanpub: NO<br>
summaryMdIsGitBook: NO<br>
codeIsPoetry: NO<br>
codeCanWrap: YES<br>
collapsibleHeadlines: YES<br>
convertGithubCheckboxes: YES<br>
convertYAMLToMMD: NO<br>
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML<br>
defaultPreviewStyle: 3<br>
defaultProcessor: MultiMarkdown<br>
enableMiniMap: YES<br>
excludeBlockQuotesFromCounts: NO<br>
excludeFootnotesFromCounts: NO<br>
excludeVerbatimFromCounts: NO<br>
excludeCaptionsFromCounts: NO<br>
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml<br>
githubNewlines: NO<br>
h1IsPageBreak: NO<br>
h2IsPageBreak: NO<br>
hrIsPageBreak: NO<br>
includeMathJax: NO<br>
includeKatex: NO<br>
limitTextWidth: NO<br>
minimalJavaScript: NO<br>
outlineModeExtensions:<br>
permissionGranted: NO<br>
printHeaderBottomLeft:<br>
printHeaderBottomRight:<br>
printHeaderFirstPage: NO<br>
printFooterFirstPage: NO<br>
printHeaderTopLeft:<br>
printHeaderTopRight: %date p. %page<br>
processHTMLFiles: YES<br>
removeMetadataForPreview: NO<br>
removeYAMLHeaders: NO<br>
scrollToEdit: YES<br>
shouldDetectCritic: YES<br>
shouldHighlightMarkupErrors: YES<br>
shouldLoadCritic: NO<br>
syntaxHighlight: NO<br>
syntaxHighlightOnlyLang: NO<br>
useCustomMarkdownProcessor: NO<br>
customMarkdownProcessor:<br>
useCustomPreprocessor: NO<br>
customPreprocessor:<br>
useFirstH1AsPrintTitle: YES</p></div>dgmagstag:support.markedapp.com,2011-09-11:Comment/471839722019-04-17T16:46:32Z2019-04-17T16:46:32ZProblem linking to local files in the same folder in exported HTML<div><p>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!</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/471839722019-04-17T17:00:55Z2019-04-17T17:00:55ZProblem linking to local files in the same folder in exported HTML<div><p>Regarding the Export... menu item, tracked that bug down and fixed for next update. Thanks for reporting.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/471839722019-04-17T20:18:51Z2020-09-16T21:46:19ZProblem linking to local files in the same folder in exported HTML<div><p>Hello Brett...</p>
<p>Thanks for your response. I've attached the files as requested.</p>
<p>(a) _about_Reference_2019_Social.Security.md (b) _about_Reference_SaveAsHTML.html (c) _about_Reference_CopyHTMLSource.html</p>
<p>The Markdown file references two pdfs in the same folder</p>
<ul>
<li>EN-05-10070.pdf</li>
<li>InnovativeSocialSecurityNov2012.pdf</li>
</ul>
<p>I've attached dummy versions of these to save space.</p>
<ol>
<li>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.</li>
<li>(b) results from the <em>Save as HTML</em> 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 matters.</li>
<li>(c) results from using the <em>Copy HTML Source</em> 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.</li>
<li>If I open (b), hover over the first link, and use <em>Copy Link</em>, the result is file:///Files/Magnuson/CloudSync/OneDrive/Reference/Year/2019/EN-05-10070.pdf</li>
<li>If I open (c) and do the same thing, the result is file:///Files/Magnuson/CloudSync/OneDrive/Reference/Year/2019/Social%20Security/EN-05-10070.pdf</li>
</ol>
<p>So it seems that the link in (b) omits the immediate folder (<em>Social<br>
Security</em>) from the path. The link doesn't work because it points to the<br>
wrong folder.</p>
<p>Hope this provides enough to figure what's going on.</p>
<p>Thanks.</p>
<p>Regards,</p>
<p>David Magnuson</p></div>dgmagstag:support.markedapp.com,2011-09-11:Comment/471839722019-04-17T20:50:13Z2019-04-17T20:50:13ZProblem linking to local files in the same folder in exported HTML<div><p>So the hrefs in the links are the same in both HTML documents. The difference is that the styled one has a <code><base></code> 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).</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/471839722019-04-18T00:12:14Z2019-04-18T00:21:25ZProblem linking to local files in the same folder in exported HTML<div><p>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!</p>
<p>Removing the < base > tag from the generated HTML file resolves the issue.</p></div>MrCtag:support.markedapp.com,2011-09-11:Comment/471839722019-04-18T01:21:53Z2020-09-16T21:46:19ZProblem linking to local files in the same folder in exported HTML<div><p>Yup, the fixed file works fine.</p>
<p>Glad you were able to track it down. Until it's fixed, I can just edit-out<br>
the offending <em><base</em> tag.</p>
<p>Thanks.</p>
<p>Regards,</p>
<p>David Magnuson</p></div>dgmagstag:support.markedapp.com,2011-09-11:Comment/471839722019-04-18T11:53:10Z2019-04-18T11:53:10ZProblem linking to local files in the same folder in exported HTML<div><p>Thanks for checking, I have this fixed for the next update.</p>
<p>-Brett</p></div>Brett