Preview render correct; HTML output isn't
I have a markdown page that has Kotlin code in it. I've fenced the code with:
<some code>
<pre><code>
The markdown renders correctly in Marked, but when I use the output to HTML save option, the resulting HTML page displays the fencing and unformatted code. I have verified there aren't any stray backticks.
Suggestions?</code>
</pre>
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
1 Posted by Bob Edmison on 05 Jan, 2023 09:29 PM
And my post was munged. Corrected:
I have some kotlin code fenced thusly:
```kotlin
<some code>
```
The markdown renders correctly in Marked, but when I use the output to HTML save option, the resulting HTML page displays the fencing and unformatted code. I have verified there aren't any stray backticks.
Suggestions?
2 Posted by Bob Edmison on 05 Jan, 2023 09:39 PM
Digging into this, I don't think this is an issue with the output style. Other builtin output forms (ie Amblin) exhibit the same issue.
Source and output files attached.
Support Staff 3 Posted by Brett on 05 Jan, 2023 10:04 PM
I'm able to output correct HTML without issue from your Markdown file. What method are you using to export the HTML? Like what steps do you take, just so I can be sure I'm replicating exactly.
Also, please go to Help->Report an Issue and copy the contents of that field into your response.
Thanks,
Brett
4 Posted by Bob Edmison on 06 Jan, 2023 04:04 PM
Thanks for getting back to me. Within the Marked window, I go to lower right, click the arrow, then click the HTML option. The save options for HTML are set as:
Include style in output : GitHub
Include Highlighting JS
Don’t include MathJax
Don’t Embed local images
Reveal in finder after save
and then click the save button.
// Configuration (do not edit)
Marked 2 1035 (Setapp)
macOS Version: 12.6.1
---
additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
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: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: YES
includeKatex: NO
limitTextWidth: NO
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: 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: NO
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES
Support Staff 5 Posted by Brett on 06 Jan, 2023 04:20 PM
It works fine for me with your settings, so I'm a bit puzzled. What gets saved as HTML runs through the same processes as what's displayed in the preview, for the most part.
Out of curiosity, if you switch to MultiMarkdown in Preferences->Processor, do you have any better luck with the export?
Thanks,
Brett
6 Posted by Bob Edmison on 06 Jan, 2023 09:58 PM
Same result, but then I unchecked the "Track CSS Changes" option in the style pref pane (not sure how it got checked), and it started working,
So, crisis averted. Thanks.