Closed btsimonh closed 3 years ago
Something like this:
{
p: {
"@someattr": "something",
"#text": [
{ span: { "@someattr2": "something2", "#text": "line1" } }
{ br: "" }
{ span: { "@someattr2": "something2", "#text": "line2" } }
]
}
thankyou :). I will play today, and if I get a chance, will work up some extra wiki text to describe...
Damn... I'm stuck down at 9.0.7 - feel like i'm in the way back time machine. It's obviously introduced after that - some work to upgrade (it's come via xml2js and node-red), or else I may just have to be creative (add a span marked as a BR and then replace in the text output would be enough :) ). Some of my customer are still on node 6.9.11 - an added complication as now you are >= node 8 :(.
Yes it was probably fixed in v11
.
the quick and very dirty:
'span':[{
"$": {
"xml:id": "sp",
},
"_": "l1",
},
{
"$": {
"ISBR": "",
},
"_":'',
},
{
"$": {
"xml:id": "sp2",
},
"_": "l2",
},
],
.....
payload = payload.replace(/<span ISBR=""><\/span>/g, '<br/>');
p.s. just love the project, but still hate coffee..... :)
Hi,
I have another thorny one.
I want to produce an element
Looking at the documentation, having the span elements separated by the br element is only possible using separateArrayItems.
However, I can't see how I could add someattr to p.....
(I know I should move on to v2, but... always worth asking).
Must I rework the code to create the xml manually using .ele() and .up() - or is there some simple trick I'm missing? Or could I phreak the writer (again) in some simple way?
br,
Simon