Additional markdown syntax

(#3536) Feature Open: Under consideration markdown

Current problem

The following markdown examples are not currently supported.

Proposed change

That the following markdown options to be made available:
  • ===text=== to highlight the enclosed string
  • Text[^1] and [^1] [elaboration] for footnotes
  • String~subscript~string for subscript
  • String^superscript^string for superscript
  • > [!TEXT] for custom callouts beyond Note, Tip, Important, Warning, and Caution
  • [text](#4b47dc) to render text with colour based on HTML colour codes

Optional Reading

In case this ends up being a place to consolidate markdown options, here are other ones I would've suggested but other posts already exist for them:

Additional information

  • I believe highlight defaults to yellow, but would probably not be noticeable on light themes, so perhaps a custom colour option?
  • Not sure how to implement custom iconography for custom callouts, maybe reference an inline SVG?
  • Footnotes would behave the same as clicking a reply header
  • There was a request for nested code blocks that show the code block inside with fully visible syntax, but I don't know what the syntax for that should be
    • Maybe escaping ` with \ (currently it renders \ directly)?

12 comments

Sign in with Fluxer to comment and vote.
Comment by gobbe
gobbe 1 vote 1 reply
the superscript and subscript look really funky would rather think something ~like this~ would be wiggly tbh (also typo the superscript is supposed to be ^superscript^)
Comment by _
_ OP1 vote
also typo the superscript is supposed to be ^superscript^
Thanks, fixed. The super/subscript syntax is a little weird, but it's the most widely used one I've seen.
Comment by vicky
vicky 1 vote 2 replies
I would personally adore having a footnote option, but I don't really see how that could work any better than what you can already do yourself with:
text text text¹
-# ¹footnote
Though that relies on you having access to the Unicode superscript numbers. The one I really, really want though is horizontal rules. I think that would make for really cool syntax and text setting options :D
Comment by _
_ OP1 vote 1 reply
Footnotes would behave the same as clicking a reply header
But to clarify, that would either mean scrolling down to that section of the message if it's outside of the viewport, and even in the case that it's not it would highlight the footnote the same as clicking on the reply header does.
Comment by vicky
vicky 1 vote
I agree, right now you can have a makeshift solution, but having it natively could be really nice!
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.
Comment by Spax
Spax 1 vote 1 reply
I'd also like to pitch
- [ ] Empty checkbox
- [x] Selected checkbox
- [-] Intermediate value checkbox
Comment by _
_ OP1 vote
Checkboxes are already suggested here and referenced in this post, and there's an active pull request for it here.