-
Notifications
You must be signed in to change notification settings - Fork 1k
Conversation
In its current form it interferes with user input. The proper way to do it was discussed in Tox-Archive/Tox-STS#74 - in short, new message type is needed in toxcore, and using that there can be a proper markdown support done. |
Hmm, I see. So there needs to be some sort of differentiation between markdown and non-markdown text. Which we could technically add with something similar to Wikipedia's "nowiki" tag, essentially cancelling out md detection within those brackets, but a user with a different client would see those brackets and be confused. Interesting. Well, when we do get a separate message type, this code'll be here to parse it :) |
@anoadragon453 You might be interested in catching up on the discussion here: Tox/Tox-Client-Standard#25 |
Thank you for the link, interesting read. A standard spec is definitely required if we are to go through with it. In my personal experience, some users turn down Tox specifically because it doesn't feature basic text formatting. IMO Toxcore should have a separate message type, each client should have a standard, non-instrusive way to switch between the two, and clients that can't support certain features should support as much as possible, and no more. Hopefully we figure out what definite route we're taking soon so we can get some implementation going. |
else if (exp.cap(7) == "_" && snippet.length() > 2) // Italics _text_ | ||
htmledSnippet = QString("<i>%1</i>").arg(snippet.mid(1,snippet.length()-2)); | ||
else if (exp.cap(10) == "__"&& snippet.length() > 4) // Italics __text__ | ||
htmledSnippet = QString("<i>%1</i>").arg(snippet.mid(2,snippet.length()-4)); |
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.
Italics 3 times but bold once?
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.
@agilob What other pattern for bold should be added? :P
It'll have to be adapted to the STS' spec eventually anyways. It's pretty simply to edit/add new syntaxes though.
On January 21, 2016 5:04:32 AM PST, agilob notifications@github.com wrote:
int offset = 0;
while ((offset = exp.indexIn(out, offset)) != -1)
{
QString snippet = exp.cap();
QString htmledSnippet;
// Match captured string to corresponding md format
if (exp.cap(1) == "**") // Bold **text**
QString("%1").arg(snippet.mid(2,snippet.length()-4));htmledSnippet =
Italics *text_else if (exp.cap(4) == "_" && snippet.length() > 2) //
QString("%1").arg(snippet.mid(1,snippet.length()-2));htmledSnippet =
Italics textelse if (exp.cap(7) == "_" && snippet.length() > 2) //
QString("%1").arg(snippet.mid(1,snippet.length()-2));htmledSnippet =
Italics __text**else if (exp.cap(10) == "**"&& snippet.length() > 4) //
QString("%1").arg(snippet.mid(2,snippet.length()-4));htmledSnippet =
Italics 3 times but bold once?
Reply to this email directly or view it on GitHub:
https://github.com/tux3/qTox/pull/2832/files#r50397534
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.
Your code:
** - bold
* - italics
_ - italics
__ - italics
** - should make bold otherwise is mega inconsistent.
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.
** - should make bold otherwise is mega inconsistent
Err, __
.
According to github editor, __
results in bold.
@anoadragon453 irungentoo/toxcore#1502 here you go, you can checkout branch and make needed stuff on qTox side :) |
Thanks, I'll start on the framework for differentiating between different message types. Edit: Nevermind, already implemented. Just need to add a new type. Edit 2: Of course we use a bool to determine message type... Edit 3: Perhaps we should put a new message type on hold and consider other options... see Tox/Tox-Client-Standard#25 (comment) |
Well, you're the one implementing it in qTox, so it's up to you when you decide to work on it. :) The way I see it (perhaps biased a bit) is that it's going to be done via Also, I don't see other options..? |
I think implementing it in toxcore is fine, but we have to do two things to implement it:
Once those two things are figured out and agreed upon, I'll be more than happy to crank out the code to make it work. |
needing to manually switch to markdown mode is stupid and a pain the point of markdown is being readable whether it's styled or not and being integrated into plaintext |
@ProMcTagonist Good point, if we're not doing another message type, then there's no need to check. |
@ProMcTagonist http://thread.gmane.org/gmane.text.docutils.user/4104/focus=4105 But in my opinion this is not a problem. |
That doesn't matter. What matters, is whether you can send a non-marked by markdown message. @tux3 how do you plan on doing this, when there'll be only md-marked messages? |
People sending codeblocks through tox should use the MD code formatting because otherwise it'll get all stripped in most clients anyway so codeblocks are an argument pro-constant-markdown @tux3 That looks like a neat solution, no characters are removed -> no problem |
@anoadragon453 No. |
@zetok |
Yes, it will be best to have an option to not render it if they don't like it. @tux3 +1 |
I vote for constant markdown parsing, in the normal message type, keeping signal characters like gmane, and an option not to render styling |
The problem with not removing signal characters is that you have the obligation to have them visible to have the styling. |
It's not about liking it or not - it's about preserving information, with which markdown interferes. Depending on the degree of "support" for markdown, it wouldn't interfere much, or would interfere to a degree where receiving (& rendering) side would have some info from message simply stripped. Option to not render it (some quick switch [under r-click?]) is probably the solution. :) |
This was my concern too, until:
So everything is preserved. |
@zetok |
I'd like to point out that copying a MD'd message perseveres the non-parsed text. |
@anoadragon453 it should be viewable without pasting to a text editor, which gmane solves nicely |
@ProMcTagonist I'm unfamiliar with Gmane, how does it do this exactly? |
+1 |
@@ -54,6 +56,10 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString &sender, const QSt | |||
//quotes (green text) | |||
text = detectQuotes(detectAnchors(text), type); | |||
|
|||
//markdown | |||
if (Settings::getInstance().getMarkdownPreference() != 0) |
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.
You should use an enum for the preference instead of a magic value
@anoadragon453 could you please write a few words about this new feature in the user manual? |
@sudden6 Sure, just in the wiki? |
The user facing things are documented in /doc/user_manual_en.md |
@sudden6 Added, thanks. |
@tux3 Addressed the issues. |
I'll take a look at it as soon as I can |
@zetok Good catch, fixed. |
@tux3 Anything update on this? |
⌛ ... |
⌛ ... +1 |
Any update on this? I downloaded the most recent version and I don't see any markdown options. Presumably, this branch wasn't merged yet? |
@Deleetdk This PR has not yet been merged. You can see this indicator next to the title in Github's web interface that lets us know it's still open: When it turns purple and says "Merged," you'll know a PR was merged. (Red with "Closed" means it's rejected.) |
Are we still waiting for the Tox Standard to decide the md rules? On March 11, 2016 1:15:06 PM PST, ProMcTagonist notifications@github.com wrote:
|
Due to the inability of the Tox Standard to actually standardize things, we will move forward with Markdown support now and deal with standard conformance when there is something to conform to :) |
How long does it take for the builds to be updated? Specifically, the Windows 64-bit one. |
For the nightly builds, usually around ~30 minutes but since Jenkins is really busy at the moment count an hour or two. |
Thanks for merging, I'll keep an eye on how the standard progresses and update accordingly 👍 |
"standard" is IMO currently a ~joke, and thus waiting for it is most likely a waste of time. |
Underline, Italics, Strikethrough and Bold supported. Addresses #2497