Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Problems with Multimarkdown fenced code
-
I've got
Multimarkdown
turned on in settings. I type some fenced code like this:empty line three backticks code line 1 code line 2 three backticks empty line
The syntax highlighting always shows me a code block, as I expect. But Editorial's preview and the output from the action
Convert Multimarkdown
have two problems:- I see
code line 1 code line 2
all on the same line, because returns (new-lines) are ignored. - If there is an empty line anywhere in the fenced code block, the fenced code is treated as normal markdown, not fenced code.
These problems are caused by Multimarkdown wrapping the fenced code with
<p><code>
tags, not<pre><code>
. And if there is an empty line in the fenced code, it puts a<p> </p>
there. - I see
-
Bugger, lost my first version with a careless touch to the wrong part of the screen. Wouldn't have happened on a laptop! Once more with feeling:
I second and +1 this one, as it affects me greatly, as I make a lot of use of these in work-related docs, and it was immediately apparent even on the very first document I happened to load up to play with in my newly-bought Editorial.
With Multimarkdown selected in settings, I believe 3-backticks-style fenced code blocks should work and don't. I think they're just being interpreted as inline-code. This, plus the fact that the indented-block method does work, can give at least some of the odd effects we see; as for example, as soon as there's a blank line followed by something indented, the code block finally starts, and when there's another blank line followed by a non-indented line, it turns off again. You can imagine the mess this makes of pasted bits of source code.
It would be easier to deal with at least if I could find a way to indent or outdent multiple lines in Editorial (like splat-[ and splat-] in Sublime Text for instance), but otoh... I use fenced blocks because doing that indenting on everything I want to paste in is too much effort even in Sublime Text.
Fenced code blocks are right there in the Multimarkdown cheat sheet here; so while they're often described as "github-style" (because they are, relative to plain markdown), they are expected functionality for a multimarkdown settings switch too. :-) Syntax colouring would be a nice-to-have there, but it actually producing a code block at all where it should is a must. :-)
Otherwise, it's all looking very promising. :-)
-
Having a similar issue (Amazing app by the way).
I've imported a .md file with fenced code blocks and it sees the first 2 back ticks as a pair inline code backticks. Then, as I was messing around trying to find the symbol in the iOS keyboard, somehow I got the fenced code block to start working.
However, I haven't been able to replicate this behaviour again and the preview still shows the working fenced code block as it being all on one line. And I've never had syntax hilighting in 'preview' - is this normal?
Edit: Seems like there was a leading space before the code block start that stopped it triggering. Even after it triggered it was still rendered as one line and not hilighted.
Hope this doesn't sound like a nag post, just thought id contribute to a small flaw in an almost perfect app.
Regards.
-
I love Editorial but this is a sticking point for me as well. I use Jekyll for blogging on github and rely on fenced code blocks for appropriate syntax highlighting in polyglot posts.
Cheers!
-
I haven't quite figured out yet, why this doesn't work properly in MultiMarkdown mode, but it will definitely be fixed in the next update when not using MMD (the "regular" Markdown conversion in Editorial also supports quite a few MMD-like extensions, so this might be an option if I can't get this to work...)