-
SamWhited
Guus, Ge0rG: I tried to address some of your feedback as well as make the text clearer in places: https://github.com/xsf/xeps/pull/540/files
-
Guus
SamWhited: would it make sense to update the "last updated" timestamp? I was refreshing my page, waiting for the build to succeed by looking at that date...
-
Ge0rG
Wow, so much constructive feedback on a Friday night. Breaking the problem space into pieces really pays off :)
-
Kev
Ge0rG: Thought it might :)
-
Ge0rG
Kev: thanks for making me do it :)
-
SamWhited
Guus: oops, sorry, I haven't been pushing versions.
-
Guus
SamWhited: no worries. Perhaps something that could be automated?
-
SamWhited
Guus: I don't think it's really necessary in this case; generally I just ask authors to update it when they make a PR. I just didn't do it for this because it gets reset to 0.1 when accepted anyways and the old ones would go away
-
Guus
Oh, I was referring to the datestamp on top, not then version number
-
SamWhited
oh, my mistake
-
SamWhited
they're the same thing though
-
SamWhited
that's pulled from the last revision block, IIRC
-
Guus
jabber.org's cert expired 4 hours ago
-
Guus
is that iteam's server to manage?
-
ralphm
Guus: no. The jabber.org server is not an XSF activity. That said. There is an overlap between the people running that server and iteam
-
ralphm
I'll nudge Edwin
-
Guus
thanks
-
Guus
Hurgh. Finally implemented most of Message Styling, SamWhited - what a drag :(
-
Guus
didn't do the nesting
-
Guus
I'm still in the opinion that the amount of complexity in the XEP doesn't warrant the benefits. I expect that a good deal of devs will only do the easy bits, or will do the non-easy-bits wrong.
-
Guus
I'd drop the recursion/nesting, and potentially all block definitions completely.
-
Guus
_that said_: *yey styles!*
-
Guus
(the other way around - the benefits don't warrant the complexity - but you got what I ment)
-
daniel
Guus: complexity? My parser (including blocks and nesting) is less than 50 lines
-
daniel
And that's Java with all its boilerplate
-
zinid
how do you tolerate java btw? the boilerplate is so annoying, I can't stand it
-
Ge0rG
daniel: is it easily exportable into other Android projects? 😁
-
daniel
Ge0rG, i've been meaning to put this into an actual library. but you could already copy paste two class files and then have a static StylingHelper.style(Editable editable)
-
daniel
https://github.com/siacs/Conversations/blob/master/src/main/java/eu/siacs/conversations/utils/StylingHelper.java
-
zinid
public static void (c)
-
daniel
zinid, it's actually gotten a lot better with Java 8 (which you cant use on Android but i use that for my other projects)
-
daniel
plus IDE takes a lot of the pain away
-
zinid
I need to look at it then, I have heard java 8 has some improvements
-
Ge0rG
daniel: great! But please make it a library... I always wanted to have one that would convert xhtml-im into Android Spannable, but I suppose I can give up hope now
-
daniel
yeah i like it a lot. even my seeminly small tools like the complinace tester or the uptime monitor (status.conversations.im) are java 8
-
daniel
i very rarely use so called scripting languages
- zinid too, I use ocaml for scripting :D
-
moparisthebest
zinid: can confirm Java 8 makes a huge difference
-
SamWhited
That bad? How did you implement it? I just recursed into the blocks and it was fairly easy
-
SamWhited
/cc Guus
-
Guus
SamWhited: You just used the words 'recurse' and 'simple' in one sentence.
-
SamWhited
What? It made it very simple
-
SamWhited
It meant I didn't have to special case the stuff inside blocks, just call the parse function again
-
Guus
Recursion is inherently complex. Not MUC complex, but a lot more complex than should be needed to print a couple of words in a bold font.
-
Ge0rG
I wonder how many levels of recursion one can get into a single message
-
Zash
What stack size limits do you have?
-
daniel
Ge0rG, not that many actually. because limited keywords
-
SamWhited
I didn't bother setting one, the stack is cheap so if you want to send: > >> >>> >>>> Up to the limit your server allows for body size then be my guest
-
Ge0rG
daniel: only if you prevent recusing into a keyword type that's already on the stack
-
daniel
i mean you couldn't just write *_*_*test*_*_*
-
daniel
thats invalid syntax
-
SamWhited
Oh, I didn't do recursion inside spans, that was simpler
-
Ge0rG
You could add letters and whitespace?
-
Zash
What, can't have bold */and/* italics?!
-
daniel
Ge0rG, true
-
SamWhited
Zash: that should work
-
Guus
If you'd use underscores instead of slashes.
-
Ge0rG
SamWhited: without recursion?
-
Guus
Bold *_and_* italics.
-
SamWhited
Ge0rG: yes, I think so. Let me clean this up and push it
-
daniel
or maybe not. i'm confused
-
Guus
Daniel, I think that there's a small omission in the preformatted block ending in Conversations
-
daniel
Guus:?
-
Guus
it appears to end on any occurrance of ```, instead of on a line that only contains ```.
-
Guus
This should not be monospaced. ``` if ( foo.equals( "```" ) ) { // This should be monospaced (but is not in Conversations) } ``` again, no longer monospaced.
-
Guus
ah, I see that the same applies to the start
-
daniel
Yes I think that got changed recently in the xep, right? I didn't follow your discussion yesterday
-
Guus
not sure, only worked on that today :)
-
SamWhited
Yah, I just tried to clarify that block, I think it makes it a little easier if you can just scan line by line.
-
Guus
but it stands to reason that ```this should not be monospaced``` (although `this` should).
-
SamWhited
The way I wrote my version having the ``` (which is the start of a block) inline means blocks overlap though, which ends up being way more complicated
-
SamWhited
but I could go either way
-
daniel
Fwiw in whatsapp triple back ticks don't need to be in their own line
-
daniel
Haven't check slack yet
- Guus shurgs and mutters something about disliking code blocks in IM in the first place
-
Guus
I'll go do my grumpy old man routine in front of the tv. Will lurk on mobile for a bit.
- SamWhited really likes pasting code blocks at work
-
daniel
I don't really care. It's a simple fix in my parser to only allow it when it starts with a \n
-
SamWhited
but could go either way
-
Zash
I usually just pastebin stuff I want to show
-
Zash
Spoiled by mod_pastebin mayhaps
-
daniel
how does the ignoring part go along with the first section where it says that keywords should stay in there?
-
Flow
Are, and if, how are, new lines defined in <body/>/XMPP?
-
SamWhited
daniel: good point; maybe I should change that to read "it's part of the keyword, not the preformatted block"
-
SamWhited
Flow: \n
-
Flow
SamWhited, great, where is that specified?
-
SamWhited
Flow: I don't follow, that's just a newline… I didn't mean literally typing \\n
-
Flow
Well strictly speaking \n is just a line feed
-
SamWhited
Oh I see, are you worried about people sending \r\n?
-
SamWhited
I have no idea if or where that's specified
-
Flow
Even more worse, a line break convention that doesn't end with \n
-
SamWhited
I wouldn't worry about it too much.
-
SamWhited
Maybe XML specifies a line ending to use? I have no idea. As far as styling is concerned that's deliberately handwavey though.
-
Flow
Well if we don't have it specified, and if a XEP speaks of newlines, then it should be specified to be sound
-
Zash
I wouldn't count on \r\n surviving exactly like that all the way across the XMPPnet
-
SamWhited
My XML decoder appears to normalize to \n
-
Flow
Zash, within <body/>? Any sane XML parser would not touch element text.
-
SamWhited
Changing everything to \n seems perfectly sane to me
-
SamWhited
But I'm still not sure if everything does that, maybe that's just this one
-
ralphm
https://www.w3.org/TR/REC-xml/#sec-line-ends
-
Zash
IIRC we looked at having Prosody preserve all kinds of whitespace, and everything broke.
-
SamWhited
Thanks ralphm
-
SamWhited
There we go then. That explains why this has never been an issue in any XMPP clients I've ever used.
-
Flow
"MUST behave as if". I wonder what that is supposed to mean. But yes, looks like that any sane XML parser is supposed to normalize line endings to \n. XML 1.1. converts even more to \n
-
Zash
There was something that at least Prosody did to whitespace in some places. Maybe attributes? I forget.
-
Flow
Zash, maybe the whitespace between attributes?
-
Zash
Yes but no, that's not what we were looking at.
-
Zash
https://hg.prosody.im/trunk/rev/6e67c73f730c https://hg.prosody.im/trunk/rev/9030b056bd4a
-
Zash
https://www.w3.org/TR/REC-xml/#AVNormalize
-
ralphm
Well, XML 1.1 is much too newfangled for XMPP.