-
-
Notifications
You must be signed in to change notification settings - Fork 4
Create message-markdown.md #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a716d4
e31e20a
77e627b
e612cb0
e895351
12e3afb
8982e9a
80adadb
aa8acee
5af8ff7
1dc740f
c465e85
d1b3e06
b055214
e9ba09b
640e49e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Markdown in messages | ||
|
||
> This list is for every formating thing that goes beyond plain-text. | ||
|
||
Deltachat is going to support the following subset of markdown: | ||
|
||
### `*italics*` and `_italics_` | ||
|
||
No whitespace as first nor as end char: | ||
correct: | ||
|
||
``` | ||
*italics* test | ||
*italics test* | ||
``` | ||
|
||
wrong: | ||
|
||
``` | ||
* italics* test | ||
``` | ||
|
||
### `**bold**` and `__bold__` | ||
|
||
No whitespace as first nor as end char: see italics examples. | ||
|
||
### `~~strikethrough~~` | ||
|
||
No whitespace as first nor as end char: see italics examples. | ||
|
||
### `https://delta.chat` - Urls | ||
|
||
Make URLs clickable. | ||
|
||
### `<http://example.org>` - Urls | ||
|
||
### `` `inline-code` `` | ||
|
||
useful to send non markdown text in your message like source code snippets. | ||
Should get rendered in a monospace font and with a different background. | ||
In contrast to bold, italics and strikethrough the content of inline-code can contain spaces at begining and ending. | ||
|
||
### ` ``` fence code block ``` ` | ||
|
||
``` | ||
Similar to `inline-code` but not inline and it may supports code highlighting. | ||
``` | ||
|
||
` ```[lang?] [content]``` ` (square brakets symbolize being a variable and are not used when using code blocks) | ||
A bit modified from the common syntax to allow one liners. | ||
Also get displayed with an monospace font (a side effect of this is that it allows to display small ascii art). | ||
The code **highlighting** is **optional** as implementation (time)cost | ||
may not be worth the small gain. | ||
The `language` definition should be parsed separately and omitted in this case (for oneline code blocks, because we cant differentiate it from content in this case). | ||
So the `language` definition is only detected if there is an linebreak following it. | ||
|
||
see https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting | ||
|
||
examples: | ||
|
||
<pre>```sh | ||
echo hi | ||
```</pre> | ||
<pre>``` | ||
echo hi | ||
```</pre> | ||
<pre>```echo hi```</pre> | ||
|
||
### `:emoji:` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. never got the point from these kind of emoji ... esp. as we already support utf-8-emojis directly. I would strike that for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its mainly that you can type an emoji without searching it in the loooong emoji keyboard. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay, that's a point :lach: mainly useful for desktop. however, maybe the type-in can be converted to a unicode character before sending. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its also useful on mobile, try typing :+1 for example on telegram on android (I am not sure if telegram iOS has this feature too right now because I haven't used telegram iOS in a while.) |
||
|
||
- could also be used for custom dc emojis | ||
|
||
### labeled links: `[Name](url)` links | ||
|
||
When implementing this make sure to show the user the hidden url in a confirmation dialog to make scamming harder. | ||
Also show the url as encode punycode to make punycode attacks useless. | ||
Optionaly a client can implement a system to trust an domain (an "don't ask a again for links on this domain" checkbox in the confirmation dialog) | ||
|
||
### Bot `/commands` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regex could look like this (but keep in mind that this doesn't allow whitespaces inside of the command): /(\/[a-Z0-9]+)\s/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also should the current draft be replaced by it or only if the draft is empty? CC @r10s @adbenitez There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the current android implementation taken from @adbenitez replaces the draft. |
||
|
||
On click the command gets prefilled as the draft so it can be easialy send. | ||
|
||
## `#tag` | ||
|
||
Basically a clickable search shortcut. On click it opens the message search prefilled with that tag. | ||
|
||
Inspired by twitters and telegrams #hashtag funtionality. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we still need to discuss how to parse hashtags:
|
||
|
||
## Future: | ||
|
||
### `mailto:[email protected]` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also here i suggest to use mailto:[email protected] instead, however, emails and most http-links are already now clickable on android without special formatting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is to put every formating thing on this list that goes beyond plain-text. Maybe the naming of the file could be improved in that regard There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
plain email addresses are clickable on dc-android, but mailto: urls aren't :( |
||
|
||
Make mailto links clickable with all parameters: `?subject=Sample%20Subject&body=Sample%20Body` | ||
|
||
### Custom Deltachat URI Scheme | ||
|
||
see https://support.delta.chat/t/custom-deltachat-url-scheme/346 | ||
|
||
### Mentions `@username` | ||
|
||
Clickable. (could get replaced with an user hash/email/id on send/on recieve so that it's still valid on name change.) | ||
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, that would be nice. however, it might get a bit tricky as there is not really a unique username currently. @[email protected] looks a bit strange. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user will probably type the current username, but dc can save/transmit it in another format. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
one idea is that as simon says, when mentioning the original email contains the user's email, just that dc replaces/show that email in messages as a @tag with the display name we have for that user, if we don't know that address the full email should be shown then, it is just a display thing, internally no name is sent, only email addresses which should be unique |
||
|
||
On sending/recieving this is tranformed into an internal representation: | ||
|
||
Implementation idea: | ||
|
||
1. user types @Displayname and at best gets autocompletion while typing the url | ||
2. on sending the username is converted to the transmition format (special format that contains the email address as id) | ||
3. on recieving/storing the message inside of the database this format is converted again to contain the local contact id to allow for future email address migration/rotation. | ||
(4.) on forwarding/sharing as chat history the id representation needs to be converted from the contact id format to the transmition format again | ||
|
||
see discords mention code for reference/inspiration https://blog.discordapp.com/how-discord-renders-rich-messages-on-the-android-app-67b0e5d56fbe | ||
|
||
### $[inline TeX]$ $$[Tex displayed in block(new line)]$$ | ||
|
||
for sharing math/physics equations in LaTeX format. | ||
see https://support.delta.chat/t/latex-code-in-deltachat/558 | ||
|
||
### Telephone numbers (idea) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a tricky question to decide if/how we support it. most chat/android apps do this rather wrong and suddenly every longer number is detected as telephone number. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ftr: we are currently relying on what android/ios system suggests wrt phone numbers, iirc, that not that bad. |
||
|
||
- format: +[country][area] [number] (again square brakets indicate variables) | ||
make them clickable similar to `tel:` links | ||
|
||
## Things that will not be suported: | ||
|
||
- Inline HTML | ||
- underline - can be confused with links | ||
|
||
## other / internal | ||
|
||
- Text | ||
- linebreaks |
Uh oh!
There was an error while loading. Please reload this page.