I’m trying to use Markdown to apply bold and italic to the same text. I’ve tried wrapping the text in three asterisks, and also two asterisks that are in turn wrapped in underscores.
I just tried to share my code here in the forum, but even the code blocks render the markdown (both of which render correctly on the forum, btw)
Both of these render correctly when I preview the the HTML, but the source text doesn’t update the way bold text or italic text on its own would.
Is there a way to apply Markdown correctly so it will look bold and italic in the editor?
I suspect that the Markdown parser is at fault here - some of them can handle this and some can’t, this may not be in the original Markdown spec hence it not being present in all
On the topic of code blocks:
I can create code blocks fine (I’m using three backticks - ` - above and below my code).
Thanks Rosemary. I was just using the code button in the toolbar here, which indents preformatted text by 4 characters. I’ll use backticks next time
What happens if you put a space between the single asterisk and the double?
It doesn’t render in Drafts’ editor as bold & italic, but you can get rendering in preview (3rd paragraph).
Either there is no italic-bold font to apply, or the parsing isn’t recognising the nested Markdown.
To be honest, I’m not sure my (custom) Markdown parser (embedded deep in one of my projects) would get it right. It’s a toughie.
(And a few weeks ago I thought I saw a problem with backticks for code in the parser. It’s probably a nearby area of the code.)
Yeah, I can see how it would be tough.
And a lot of editors don’t handle bold/italic in Markdown exactly the way you’d expect. E.g. Markdown Mode in Emacs, which has been around nearly 15 years, will apply either bold or italic, depending on how you format your code.
At the end of the day, the in-editor highlighting is just a convenience, especially since it exports correctly.
Sublime Text - I found out yesterday - doesn’t tolerate a space after double asterisk. I think it should. (My code does.)