-
-
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice you push that forward 🛩️
message-markdown.md
Outdated
Similar to `inline-code` but not inline and it may supports code highlighting. | ||
``` | ||
` ```[lang?] [content]``` ` | ||
A bit modified from the common syntax to allow one liners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```[lang?] [content]```
is to mark a line of c/rust/java/whatever code? this seems to be a quite tricky part and/or needs a lib that supports that. not sure if this is really needed in every day use for most users but it raises the barrier of supporting markdown if we say "Deltachat is going to support the following subset".
i'd suggest to strike that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest marking the actual syntax highlighting as optional (if the client doesn't want to support it it can just ignore the lang definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the content has to be put in square brackets? or as in https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting ? however, as mentioned, i would not add this to the spec in this early level anyway :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no the square brackets are my description of a variable here. It is the same syntax as in the link you mentioned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was stumbling over the square brackets too, because I thought thery're part of the syntax. Maybe you can remove them in the example to avoid confusion?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
githubs editor doesn't work currently so maybe we can write it like
```language content```
or ``` content```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also there is a question how to go about no language definition, At the moment I think one space before the content is fine, but not optimal. We could also go no language support in single line mode
|
||
## Future: | ||
|
||
### `mailto:[email protected]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 comment
The 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 comment
The 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.
plain email addresses are clickable on dc-android, but mailto: urls aren't :(
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.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
however, as it is in the "future" section, it's probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
Discord has an even more strange code https://blog.discordapp.com/how-discord-renders-rich-messages-on-the-android-app-67b0e5d56fbe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
however, it might get a bit tricky as there is not really a unique username currently.
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
as it can be confused with links see deltachat/interface#20 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more comments.
message-markdown.md
Outdated
Similar to `inline-code` but not inline and it may supports code highlighting. | ||
``` | ||
` ```[lang?] [content]``` ` | ||
A bit modified from the common syntax to allow one liners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the content has to be put in square brackets? or as in https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting ? however, as mentioned, i would not add this to the spec in this early level anyway :)
may not be worth the small gain. | ||
The `language` definition should be parsed separately and omitted in this case. | ||
|
||
### `:emoji:` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 comment
The 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.
Telegram or discord for example provide also auto completion with this syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 comment
The 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.)
and move alias links to the supported feature set
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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
the current android implementation taken from @adbenitez replaces the draft.
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
we still need to discuss how to parse hashtags:
telegrams rule seems to be
#
everything (besides#
) until space/linebreak/tab- must end with EOF/space/linebreak/tab (but don't consume it)
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 comment
The 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.
we detect only specific well-defined telephone number formats.
but anyways the whole thing is a whole science on its own so maybe we should just use tel:number links for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
The message markdown file was moved to https://github.com/deltachat/message-parser/blob/master/spec.md, so maybe we should link from there to this and close this pr. |
No description provided.