I think I've figured out, how to escape html tags in a way it does not break in #Olifant, when using #Pleroma. Not a good way IMO, but at least it is more or less easy to predict behavior 😄️

@wolf480pl @alex because GTK markup does know nothing about paragraph HTML element 😔️

Ok, but if you didn't delete it, your later regex would make it linebreak, no?

@wolf480pl @alex basically, yes. Here I presumed that <p> tags are followed by other <p> tags, so closing of paragraph creates line break which is needed to display the paragraph...

But I've just figured out that I should remove only leading <p> tag, while replacing every other with line break.

@alexcleac @alex yeah, like, it's legal HTML to make paragraphs like

<p>First paragraph
<p>Second paragraph
<p>Third paragraph

@wolf480pl then I am screwed, because I need to implement conversion of html to gtk markup to display posts correctly...

@alex maybe you could remove the first <p>, and then replace (</?p/?>)+ with newline?

@wolf480pl @alexcleac @alex IMO the code shouldn't rely on what's legal and see what the backend *generates* instead

I haven't seen any peculiar cases like this and accounting for them would would only complicate things

@bleakgrey @wolf480pl @alex well...pleroma allows HTML posts to be sent, so supporting correct rendering of HTML would be rather good thing to have. Though it is just too much work to do, so I think I'll end up with something I have at the moment :)

@wolf480pl Thank God the first HTML standard I learned was XHTML

@naruciakk an HTML document can be serialized in two ways:
- XHTML - an XML-based serialization format for computers
- HTML - an SGML-based mistake-tolerant language for sloppy humans to be able to make websites in notepad

I don't think any of them is inherently worse than the other, they just serve different purposes.

@wolf480pl @naruciakk Personally I wish we had come to a better compromise between the two camps... I've got one I'm trying out...

Sign in to participate in the conversation
Mastodon for Tech Folks

mastodon.technology is shutting down by the end of 2022. Please migrate your data immediately. This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!