mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:35:10 +00:00
[MOD] Do some tricks to make formatting nicer
It just didn't make sense on basic messages and Element Android. Fluffy behaved as excepted, though.
This commit is contained in:
parent
0cccef7194
commit
05be7fe249
2 changed files with 19 additions and 8 deletions
|
|
@ -399,21 +399,37 @@ ShoveXML(XEP393Element *element, XMLElement *xmlparent)
|
|||
char *
|
||||
XEP393ToXMLString(XEP393Element *xepd)
|
||||
{
|
||||
XMLElement *root;
|
||||
XMLElement *root, *act_root;
|
||||
XMLElement *child;
|
||||
|
||||
Stream *writer;
|
||||
char *ret = NULL;
|
||||
size_t i, children;
|
||||
if (!xepd)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
root = XMLCreateTag("span");
|
||||
act_root = root;
|
||||
ShoveXML(xepd, root);
|
||||
|
||||
writer = StrStreamWriter(&ret);
|
||||
XMLEncode(writer, root);
|
||||
XMLFreeElement(root);
|
||||
children = ArraySize(root->children);
|
||||
|
||||
child = ArrayGet(root->children, 0);
|
||||
if (children == 1 && StrEquals(child->name, "p"))
|
||||
{
|
||||
children = ArraySize(child->children);
|
||||
root = child;
|
||||
}
|
||||
for (i = 0; i < children; i++)
|
||||
{
|
||||
child = ArrayGet(root->children, i);
|
||||
|
||||
XMLEncode(writer, child);
|
||||
}
|
||||
XMLFreeElement(act_root);
|
||||
StreamFlush(writer);
|
||||
StreamClose(writer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue