Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When encountering a text with the 'align' attribute added, the subsequent default attribute text content incorrectly uses the previous 'align' attribute #1322

Open
terry2010 opened this issue Mar 22, 2024 · 0 comments

Comments

@terry2010
Copy link

terry2010 commented Mar 22, 2024

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"}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant