curly quotes break rendering
// Please enter a detailed description of the issue // Description of the issue:
Whenever I have a curly quote (“ or ”) in my markdown, Marked refuses to render anything when I open the doc--I just get a blank document. If Marked is already open and displaying the document I'm editing, and I add a curly quote, then it either spins for a bit and does nothing, or gives me an error saying it's an unrecognized file type.
I get it that curly quotes make it not plain text, but it'd be great if Marked could still try to render everything else and replace problematic characters with some placeholder icon so I could more easily find the problem. As it is, if I don't immediately know where the problem character is (e.g. when pasting in a bunch of text), I end up having to binary search. Not a huge deal, just a little annoying.
// Please enter a list of steps required to reproduce the issue // Steps to reproduce:
- Create a markdown doc with a curly quote in it (“ or ”)
- Open in Marked
// 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.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: YES
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES
- curly_quotes_break_things.md 45 Bytes
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 19 Feb, 2021 12:01 AM
Under neither built-in processor should this be an issue. I tested curly
quotes in both the Discount and MultiMarkdown processor and they
rendered fine, just as you would expect. Your sample document, however,
does not contain curly quotes by any ascii standard. What editor created
this file, and what language do you usually work in?
If I open it in Sublime Text, I see `It has Òcurly quotesÓ.`. If I
open it in MultiMarkdown Composer, it's in what appears to be Japanese.
-Brett
2 Posted by Chris Bartley on 19 Feb, 2021 02:02 AM
Ah! Interesting! I only have the problem when creating with IntelliJ IDEA. If I create in TextEdit, it opens in Marked just fine. I've attached a zip with two test files--one created in IntelliJ IDEA, the other in TextEdit. I copied the curly quotes from here:
https://www.compart.com/en/unicode/U+201C
https://www.compart.com/en/unicode/U+201D
Double-clicking the one created in IntelliJ causes Marked to give the error. Double-clicking the one created in TextEdit opens in Marked just fine.
I use Marked's GitHub processor exclusively.
Also, FWIW, using TextEdit to open the one created in IntelliJ renders the curly quotes just as expected. No Japanese or whatnot.
Thanks!
Support Staff 3 Posted by Brett on 19 Feb, 2021 11:39 AM
Can you tell IntelliJ to use UTF-8 encoding?
- Brett