PptxGenJS
PptxGenJS copied to clipboard
[BUG] When encountering a text with the 'align' attribute added, the subsequent default attribute text content incorrectly uses the previous 'align' attribute
Issue Category
- [✔ ] Bug
Product Versions
[ pptxgenjs 3.12.0 ] [ PowerPoint 2013 /wps latest version] [ chrome /firefox ]
Desired Behavior
Observed Behavior
Steps to Reproduce
demo code
var tmpSlide = pptx.addSlide()
const tmpStr = [
{
text: "H2 with underline",
options: {
fontSize: 28,
bold: true,
underline: {
style: "sng"
}
}
},
{
text: "\n",
options: {}
},
{
text: "H3 Italic right aligned",
options: {
align: "right",
fontSize: 24,
bold: true,
italic: true
}
},
{
text: "\n",
options: {}
},
{
text: "H4 Center aligned",
options: {
align: "center",
fontSize: 20,
bold: true
}
},
{
text: "\n",
options: {}
},
{
text: "err:H5 shouldRestore default alignment",
options: {
fontSize: 16,
bold: true
}
},
{
text: "\n",
options: {}
},
{
text: "auto text",
options: {}
},
{
text: "\n",
options: {}
}
];
tmpSlide.addText(tmpStr, {x: 0.5, y: 1.0, w: 5.75, h: 6.0, margin: 5, fill: {color: "#FFFFFF"}})