tag:support.markedapp.com,2011-09-11:/discussions/problems/150705-single-quotes-are-transformed-to-apos-inside-code-blocks-on-export-to-markdown-from-previewMarked: Discussion 2022-06-16T00:55:49Ztag:support.markedapp.com,2011-09-11:Comment/467847652019-01-10T18:10:34Z2019-01-10T18:10:35ZSingle-quotes are transformed to ' inside code-blocks on export to markdown from preview<div><p>In the post, the &apos is rendered as ' because it's HTML of course (I'm an idiot), but in the resulting markdown file it looks like:<br>
(trying to wrap it in a</p>
<pre>
tag
</pre>
:
<pre>
```dart
var s1 = 'Single quotes work well for string literals.';
var s2 = "Double quotes work just as well.";
var s3 = 'It\'s easy to escape the string delimiter.';
var s4 = "It's even easier to use the other delimiter.";
</pre>
<pre>
<code></pre>
While it should look like this:
<pre>
```dart
var s1 = 'Single quotes work well for string literals.';
var s2 = "Double quotes work just as well.";
var s3 = 'It\'s easy to escape the string delimiter.';
var s4 = "It's even easier to use the other delimiter.";</code>
</pre>
<pre>
<br>
</pre></div>Chris Sederqvisttag:support.markedapp.com,2011-09-11:Comment/467847652019-01-10T18:59:14Z2019-01-10T18:59:14ZSingle-quotes are transformed to ' inside code-blocks on export to markdown from preview<div><p>Escaping characters available as entities is standard behavior for Markdown. I understand that it's not great for legibility and you'd like the original formatting preserved in the Markdown export, but at the point where the export is created the escaping has already taken place in the code blocks. It's something I can look into avoiding, but it's more complex than it seems on the surface.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/467847652019-01-10T19:23:42Z2019-01-10T19:23:43ZSingle-quotes are transformed to ' inside code-blocks on export to markdown from preview<div><p>Well, I've used Marked2 and Bear Notes before without having any trouble with the resulting export.<br>
What usually has been the result is exactly what I want:<br>
Quotes (single and double) are converted to typographically correct quotes in paragraph text but inside triple-quoted code-blocks, they're left as is and not converted or altered in any way.<br>
Something must have changed in either my settings, OS or apps that cause this conversion within code-blocks to happen...</p></div>Chris Sederqvisttag:support.markedapp.com,2011-09-11:Comment/467847652019-01-10T21:04:11Z2019-01-10T21:04:11ZSingle-quotes are transformed to ' inside code-blocks on export to markdown from preview<div><p>It may have been something that changed in Marked over time, but it's not something that should be affected by any available settings. I'll look into it, but there's nothing on your end that you can control on this one.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/467847652019-01-15T17:08:59Z2019-01-15T17:08:59ZSingle-quotes are transformed to ' inside code-blocks on export to markdown from preview<div><p>Ok, I have this issue fixed for the next update. It's actually going in and unescaping all entities in the code, which means it might be a bit hyper and remove intentional entities, so I'll need to figure out if I've only made the problem worse or not.</p>
<p>I've also fixed the issue where the feedback reporter was basically reporting everything as true even when it wasn't (e.g. code as poetry).</p>
<p>Thanks for the reports.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/467847652019-01-16T00:38:35Z2019-01-16T00:38:35ZSingle-quotes are transformed to ' inside code-blocks on export to markdown from preview<div><p>No, problem Brett.<br>
I appreciate the follow-up and dedication for solving the issue!</p>
<p>I'm a software developer myself, and I respect your work.<br>
I'm also a follower of your blog and you seem like a great guy.<br>
Don't mean to sound like a fanboi or anything, but I admire your work! :)</p>
<p>I've also struggled with bipolar depression and ADD for many years, so I was surprised to read about your "issues" regarding ADHD and mental barriers.<br>
But it also gave me hope, sometimes I feel like just giving up my dreams of mastering the craft of software development, it's a never ending learning race.</p>
<p>But, I'm a hardcore learning addict, so I need input to stay afloat, and reading stories from talented people like yourself and guys like Jeff Atwood gives me motivation to push on and don't give up!</p>
<p>Well, probably TL; DR. but thanks anyways!</p></div>Chris Sederqvist