-
Notifications
You must be signed in to change notification settings - Fork 15
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
Message formatting #19
Comments
👍 to a light markdown support mainly because it will degrade reasonably gracefully when not implemented. |
👍 to this, if it's standardized across all clients I'd be much happier to implement it. |
@tux3 you are willing to pull webkit as qtox dependency for this? : ) Otherwise how are you going to implement it, I'm curious. |
@nurupo Technically I think Qt already embeds some Webkit version, but I don't need webkit to grep for pairs of symbols. Light markdown is trivial to parse. |
Well, then you should standardize what you mean by "light markdown". Do you allow tables, inline images, raw text blocks, code highlights, etc? Looking at the STS issue, some people were proposing to use gh-flavored markdown. |
I'm probably not going to do tables, that seem way overkill for a chat client, but basic things like em/strong/strikethrough and maybe raw text are definitely easy to do. If we want to standardize something, I think it would be a good idea to start small and then maybe think about extending it. |
I think bold, italic, and underlines are a good feature set to start with. |
Underline is nice, but it isn't officially in markdown. What symbol would you use for it? |
|
👍 for lightweight markdown BTW the Ricin client already implements it: RicinApp/Ricin#30 |
I suggest we adapt https://help.github.com/articles/markdown-basics/ as our markdown of choice. Per wikipedia, there's no standard, so because we all use github, a lot of the usage/testing will be programmers. Github's flavor is least likely to aggravate us. |
There is no standard, but the basic things were invented by John Gruber (according to Wikipedia) and he documented it here: https://daringfireball.net/projects/markdown/ So anyone can take this as a reference. Of course you can add additional things like GitHub does with GitHub Flavored Markdown, but (except of strikethrough and autolinking of URLs) this is not a thing for a lightweight markdown. |
👍 |
@rugk I thought about that, but again per wikipedia, he's no longer maintaining it, so he no longer gets a vote. |
He set the standard and this standard was adopted (and extended) by many organisations, so it does not matter whether he "maintains" it. BTW where in the Wikipedia article is it stated that he does not maintain it? (Okay the last release of the software was in 2004, but it does not matter as we do not need the source code he wrote anyway - the spec is the thing which matters.) |
My approach to implement a lite-version of Markdown (which I called LiteMD) was this one (using simple regex): // Vala code from RicinApp/Ricin by SkyzohKey
public static string render_litemd (string text) {
var bold = /\B\*\*([^\*\*]*)\*\*\B/.replace (text, -1, 0, "<b>\\1</b>");
var italic = /\b_([^_]*)_\b/.replace(bold, -1, 0, "<i>\\1</i>");
var underline = /\B-([^-]*)-\B/.replace(italic, -1, 0, "<u>\\1</u>");
var striked = /\B~([^~]*)~\B/.replace(underline, -1, 0, "<s>\\1</s>");
var final_text = striked;
return final_text;
} Basically I just replace some expressions by their HTML equivalent (ie. I think we should provide the following Markdown "tags" :
+ Code formatting (using GtkSourceView or the equivalent in Qt) : ``language-to-highlight
var hello = "Hello, world!";
console.log(hello);
`` Lists/Tables would be shitty to implement. I think we shouldn't support them. + Maybe that Markdown could be used to have a proper quoting format. Something like:
|
IMO this is not really such a good implementation as it is not standard markdown. E.g. usually Quoting with
|
👍 For @SkyzohKey and @GrayHatter standard |
I think he means either. As is, just implement markdown of any kind
|
We should stay with the GFM or CommonMark specs. |
@stal888 👍 |
Tox-Archive/Tox-STS#74
Together we can rewrite the STS.
The text was updated successfully, but these errors were encountered: