tag:support.markedapp.com,2011-09-11:/discussions/problems/132412-syntax-highlighting-and-image-includes-in-transcluded-filesMarked: Discussion 2017-01-18T04:51:53Ztag:support.markedapp.com,2011-09-11:Comment/414209492016-12-08T14:23:47Z2016-12-08T14:23:47ZSyntax Highlighting and image includes in transcluded files<div><p>Ok, so I found a bug with the spaces on my end. I recently
changed<br>
Marked to rewrite image pqths in included files to allow relative
paths<br>
from the location of the included file, rather than from the
base<br>
directory. For the path manipulation it decodes percents in the
path,<br>
but I had the output escaping and not percent encoding the result.
This<br>
should be fixed for the next update.</p>
<p>As far as syntax highlighting, can you show me how you're
writing the<br>
includes? If you're including using normal syntax (include
Markdown,<br>
square brackets), you'd want any fences to be within the included
file,<br>
not around the include statement. If you're doing a code
include<br>
(parenthesis, e.g. <<(code.py) ) it should handle it as
expected without any fences in the original or included file.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/414209492016-12-08T17:56:49Z2016-12-08T17:56:50ZSyntax Highlighting and image includes in transcluded files<div><p>Sure. Here's an example of the includes:</p>
<p><<[front.md]<br>
<<[guided/README.md]<br>
<<[challenge/README.md]<br>
<<[summary.md]</p>
<p>When I open the files individually, syntax highlighting works as
expected. When I open this file with the transcluded files, no
syntax highlighting.</p>
<p>They're escaped code blocks with a language annotation.</p>
<pre>
<code class="swift">print("Hello, world!")
<pre><code></code>
</pre></code>
</pre></div>Caleb Hickstag:support.markedapp.com,2011-09-11:Comment/414209492016-12-08T18:08:13Z2016-12-08T18:08:13ZSyntax Highlighting and image includes in transcluded files<div><p>That's quite odd. I tested with the same type of setup and had
no issue.<br>
Could you take a look at the source view (⌘U) and see what
it's<br>
outputting for those code blocks? And let me know which processor
(or<br>
custom processor) you're using.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/414209492016-12-08T18:13:22Z2016-12-08T18:13:22ZSyntax Highlighting and image includes in transcluded files<div><p>Here's one example:</p>
<pre>
<code class="swift">let defaultScore = 100
var playerOneScore = defaultScore
var playerTwoScore = defaultScore
print(playerOneScore)
print(playerTwoScore)
playerOneScore = 200
print(playerOneScore)</code>
</pre></div>Caleb Hickstag:support.markedapp.com,2011-09-11:Comment/414209492016-12-08T18:14:23Z2016-12-08T18:14:24ZSyntax Highlighting and image includes in transcluded files<div><p>And I'm using MultiMarkdown as the processor.</p></div>Caleb Hickstag:support.markedapp.com,2011-09-11:Comment/414209492016-12-09T05:26:46Z2016-12-09T05:26:52ZSyntax Highlighting and image includes in transcluded files<div><p>!!!</p>
<p>I was doing some work tonight and noticed a little popup in the
bottom right corner while exporting to PDF. I ran the export again
to read the whole thing.</p>
<p>"Syntax highlighting disabled due to file size."</p>
<p>So I think that resolves this problem. Is there any way for me
to increase that file size?</p></div>Caleb Hickstag:support.markedapp.com,2011-09-11:Comment/414209492016-12-09T19:26:59Z2016-12-09T19:26:59ZSyntax Highlighting and image includes in transcluded files<div><p>Hmmm. So it's rendering in the preview but not in the PDF
export? I'll<br>
have to look at that. The size limit is because on really long
files<br>
with a ton of code, re-rendering the syntax highlighting on every
update<br>
causes so much blocking/freezing while processing that it starts
being<br>
unusable. I'm currently looking into moving that into web workers
that<br>
won't block, but I may need to look into allowing it on export no
matter<br>
what. Or at least offering the option…</p>
<p>There's no workaround that I can think of in the current
version, but I<br>
can figure something out for the next update. The other
possibility<br>
would be to use a custom processor that did the code highlighting
prior<br>
to render, using Pygments or Coderay along with Kramdown or Maruku
or<br>
similar. If you need something immediately, I'm happy to help you
set<br>
something like that up.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/414209492016-12-09T19:44:21Z2016-12-09T19:44:22ZSyntax Highlighting and image includes in transcluded files<div><p>That definitely makes sense.</p>
<p>The syntax highlighting is not visible in the preview or in the
export. I just noticed the messages saying that syntax highlighting
had been disabled during export.</p>
<p>My ideal version of a fix for my situation would be two
parts:</p>
<ol>
<li>
<p>Display that syntax highlighting was disabled in the corner
until I acknowledged it, not just at the end of an export, which
was the first time I saw it, leading to the confusion.</p>
</li>
<li>
<p>Process the syntax highlighting on export, since I am not making
active changes during an export.</p>
</li>
</ol>
<p>Thanks Brett!</p></div>Caleb Hickstag:support.markedapp.com,2011-09-11:Comment/414209492016-12-09T20:05:51Z2016-12-09T20:05:51ZSyntax Highlighting and image includes in transcluded files<div><p>I will do both of those things.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/414209492017-01-17T19:43:56Z2017-01-17T19:43:58ZSyntax Highlighting and image includes in transcluded files<div><p>Hey Brett,</p>
<p>I just tried out your latest version that you mentioned in
another thread.</p>
<p><a href="http://support.markedapp.com/discussions/problems/132340-marked-259-can-not-handle-relative-paths-for-images-correctly">
http://support.markedapp.com/discussions/problems/132340-marked-259...</a></p>
<p>It does not address either of the syntax highlighting issues
above. Is that still planned for this version? No worries if it's
been dropped or pushed back, I understand how things go. Just
trying to make sure I've got my ducks in a row explaining things to
our folks in layout.</p>
<p>The highlighting on export would be more important to me if
doable.</p>
<p>Thanks Brett!</p></div>Caleb Hickstag:support.markedapp.com,2011-09-11:Comment/414209492017-01-17T22:01:19Z2017-01-17T22:01:19ZSyntax Highlighting and image includes in transcluded files<div><p>I just remembered that the size limit that prevents syntax
highlighting can be defeated by unchecking "Disable
memory-intensive features on large documents" in
Preferences>General. Could you try that and let me know if it
helps?</p>
<p><img src="http://ckyp.us/Dhbf+" alt=""></p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/414209492017-01-17T22:03:19Z2017-01-17T22:03:19ZSyntax Highlighting and image includes in transcluded files<div><p>If that does fix the issue for you, I'll wait on adding the
dialog requiring user dismissal until the next update so I can get
this one out.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/414209492017-01-18T04:51:52Z2017-01-18T04:51:53ZSyntax Highlighting and image includes in transcluded files<div><p>That fixed it. I'm all set! Thanks Brett.</p></div>Caleb Hicks