SamOffice hours starting in 15 minutes! https://socialcoop.meet.coop/sam-pku-dud-niv
florettahas left
Guushas joined
Martinhas left
Martinhas joined
florettahas joined
marmistrzhas joined
gutuninghas left
gutuninghas joined
Guushas left
gutuninghas left
gutuninghas joined
selurveduhas joined
Ge0rGhas joined
gutuninghas left
gutuninghas joined
gutuninghas left
Guushas joined
gutuninghas joined
Guushas left
nad200has joined
nad200has left
gutuninghas left
gutuninghas joined
marmistrzhas left
nad200has joined
belonghas left
gutuninghas left
gutuninghas joined
belonghas joined
nad200has left
nad200has joined
nad200has left
marmistrzhas joined
nad200has joined
nad200has left
omightyhas left
nad200has joined
nad200has left
omightyhas joined
nad200has joined
marmistrzhas left
gutuninghas left
gutuninghas joined
SouLhas left
SouLhas joined
nad200has left
Wojtekhas left
nad200has joined
belonghas left
lovetoxSam, maybe im too stupid, but parsing blocks seems to be much more of a challenge then spans
lovetoxSam, maybe im too stupid, but parsing blocks seems to be much more of a challenge than spans
lovetoxbut im not giving up
moparisthebestonly need a few more regexen
ZashNo not, the term is 'regexopodes'
ZashNo no, the term is 'regexopodes'
Yagizаhas left
Samlovetox: I think I had a harder time with quotes in particular as well because they don't have any convenient "end" marker and I wanted to keep the line lengths and spaces and what not.
belonghas joined
lovetoxits the mixing that gets me
lovetoxblocks that have ends, blocks that dont have ends
lovetoxblock where the end is defined as the start of another block
SamI mostly just ignore "plain" blocks I think, so it was really just quotes for me.
Sampre's were easy because you just scan until the end of the document or the end of whatever block you were already in
nad200has left
lovetoxwho needs nested quotes
lovetoxif the xep aims at "good enough" maybe my parser should too
marmistrzhas joined
lovetoxseems weird for such a very simple styling language to support unlimited nested quotes
SamI think I always count the ">"s at the beginning of each line to get the quote level, then whenever that number gets smaller than whatever it was before I call that the end of a block.
SamOriginally I'd done that recursively where I had a byte reader that understood quotes and would only read up to the end of its own quote, sipping the ">" bytes and then I could recursively create a new decoder inside of each block, but I changed that because I wanted it to be lossless and not throw away spaces and newlines.
Sam*stripping the ">" bytes, I mean
SamI think… I rewrote this thing like 5 times before I found an API that I liked, so I barely remember what bits I ended up with.
stpeterhas joined
marmistrzhas left
lovetoxwhen clients quote, du they somehow identify the originator of the quote ?
lovetoxand how do they do that
SamNot that I've seen
ZashPlz XEPify `<in-reply-to id=$stanza-id/>` and use that 😉
lovetoxsounds like something very basic i would want to have with a quote..
ZashOr references I guess
SamI could go either way, but I'm with Zash. I think these quotes are mostly just to provide context in a MUC when multiple people are talking at once and it's not immediately clear which recent message you were relying to
SamIf you need more, this can be done with some sort of threading XEP
Zash`nick[:,]\n> lorem ipsum\n what you say‽` 🤷️
SamBut a client would certainly be free to prepend "So and so said:" before the quote like email clients do
SamYes, that :)
ZashYaxim has something too IIRC
lovetoxso > ´´´sometext
lovetoxthis is a quote with a preformated block
lovetoxthis is valid or not
Samyes that's valid
lovetoxand why do we need that? because its common to not quote the end ```
lovetox?
SamIt just made it easier because you didn't have to scan for an end token to know if the pre was valid
Syndacehas left
Syndacehas joined
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
lovetoxi think i just use regex
lovetoxfor blocks
lovetoxits easy to match a pre or quote block with regex
lovetoxthe only problem is the pre without end inside the quote block ..
lovetoxhm or can i just write a regex for that too ..
pasdesushihas left
omightyhas left
pasdesushihas joined
Samlovetox: out of curiosity, what are you writing this for?
lovetoxfor Gajim
Samoh right, I think I knew you did gajim stuff. cool.
omightyhas joined
pasdesushihas left
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
Syndacehas left
Syndacehas joined
pasdesushihas left
nad200has joined
nad200has left
nad200has joined
goffihas left
nad200has left
gutuninghas left
lovetoxSam in the xep is nothing said about empty blocks
gutuninghas joined
lovetox> ``` for example
lovetoxdont know if it should though
SamI think that's valid. It's not mentioned specifically, but I think the rules say that a pre-formatted block has to be started with "```" and runs until the end of the parent block or until the next line containing only "```", so it should be valid.
pasdesushihas joined
oibaloshas left
lovetoxso in the end now parse the blocks with regex
lovetoxworks fine for some tests i made, tomorrow i will test all your test cases