Skip to content

Conversation

Simon-Laux
Copy link
Member

No description provided.

Copy link
Member

@r10s r10s left a 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 🛩️

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.
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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 :)

Copy link
Member Author

@Simon-Laux Simon-Laux Jun 19, 2019

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

Copy link

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.

Copy link
Member Author

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```

Copy link
Member Author

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]`
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.)
Copy link
Member

@r10s r10s Jun 6, 2019

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.

Copy link
Member Author

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

Copy link
Member

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

Simon-Laux added a commit to deltachat/deltachat-desktop that referenced this pull request Jun 6, 2019
as it can be confused with links
see deltachat/interface#20 (comment)
@Simon-Laux Simon-Laux requested a review from r10s June 16, 2019 13:22
Copy link
Member

@r10s r10s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some more comments.

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.
Copy link
Member

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:`
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

@Simon-Laux Simon-Laux Jul 23, 2020

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`
Copy link
Member Author

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/

Copy link
Member Author

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

Copy link
Member

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.
Copy link
Member Author

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)
Copy link
Member Author

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?

Copy link
Member

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.

@Simon-Laux
Copy link
Member Author

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.

@Simon-Laux Simon-Laux closed this Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants