Open lengerrong opened 2 years ago
it is not xml2js lib's bug. since the json object parsed from the xml string do not have the sequence information.
{
'a:p': {
'a:pPr': [ [Object] ],
'a:r': [ [Object], [Object] ],
'a:br': [ [Object] ],
'a:endParaRPr': [ [Object] ]
}
}
and we won't be able to get below json object via xml2js lib.
{
'a:p': {
'a:pPr': [ [Object] ],
'a:r': [[Object]],
'a:br': [ [Object] ],
'a:r': [[Object]],
'a:endParaRPr': [ [Object] ]
}
}
log a ticket to xml2js, hope can find a solution then. https://github.com/Leonidas-from-XIV/node-xml2js/issues/621
test code
In the test.pptx, I have a slide which has two lines as its tile.
but the saved ppt always rendered to 1 line
I looked into the codes, we are using xml2js.parseString to parse xml string to js obj. and use xml2js.Builder to save js obj back to xml string
with below code, we can easily reproduce the issue:
The output is:
As you can see in the output, the break line node was saved after the two lines rather than between them.
That is the reason why multi line was saved into 1 line.