Additional markdown syntax

(#3536) Feature Open: Under consideration markdown

Thread

Comment by vicky
vicky 1 vote edited 4 replies
As for nested code blocks, right now "\" as an escape character is behaving really weird (or at least I can't make sense of it)¹. ¹ Actually not that weird now that I've studied it more, it just doesn't escape itself — which is not that strange. I can't escape myself either.
  • In single-line codeblocks (`) it escapes normally, while,
  • In multi-line codeblocks (```), it doesn't:
    \`
    
However, trying to escape an escape character ("\") (still in single-line codeblocks) does not work:
  • \\ (two "\" inside backticks renders two "\" instead of the expected one).
However writing a single backslash inside backticks: ` successfully escapes the second backtick, resulting in — as you can see — less-than-ideal results.

My suggestions

  • make the whitespace backtick backslash backtick whitespace a special exception where in this one case the backslash doesn't escape.
  • make backslashes escape normally inside multi-line codeblocks, allowing for:
    \`\`\`LaTeX
    \LaTeX\space the LaTeX logo
    \`\`\`
to render as three backticks without the backspaces; so that copy-pasting the codeblock would work as a latex codeblock.
Comment by sodiboo
sodiboo 1 vote 3 replies
you can already include a literal ``` by delimiting with ```` (or keep adding backticks until your codeblock doesn't contain the delimiter anymore; i use 5 in the example):
````
```LaTeX
```
````
becomes
```LaTeX
```
and for a single backslash, you can already use ``\``. i'll put it right here: \ and you'll see it doesn't interact with my trailing/dangling backticks``.
this codeblock resets the parser's state, to prevent the dangling backticks above from blending into the next sentence
doing this is fine, because to escape `` requires \`\` (<-- to write that, each slash is triple and there are two backticks around the whole thing). simply putting one backslash like \`` is not enough; the two backticks are still adjacent, so they still end the inline code. indeed, i agree that single-backtick inline code behaves super strangely. but using two backticks seems to prevent all that weirdness. i always use two backticks because my deadkeys make it hard to write just one backtick; as such, i've never had any problems with inline code blocks. they're generally very predictable for me.
Comment by vicky
vicky 1 vote 2 replies
Interesting! Thanks for the workaround. I still think the behaviour could be more streamlined; but that's useful to know!
Comment by sodiboo
sodiboo 2 votes 1 reply
yeah, i guess. but really, the main issue is the lack of clearly visible documentation. we're all just going off the vibe that it is "like discord markdown" but i really feel like the app(s) could use some built-in documentation / a "cheat sheet" for the markdown syntax. and maybe have some WYSIWYG-style controls in the context menus (compare Signal) to automatically escape things in just the right way.
Comment by vicky
vicky 1 vote
I wholeheartedly agree with you on needing guides. I built a community around creating resources for Fluxer and have a guide on Markdown (that I will update with your new knowledge); but it would definitely be best to have an official guide for this and most features.