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

Breakline does not work #730

Closed
iranadryan opened this issue May 5, 2020 · 8 comments
Closed

Breakline does not work #730

iranadryan opened this issue May 5, 2020 · 8 comments

Comments

@iranadryan
Copy link

array.push({ text: m[1], options: { color: '0070C0', breakLine: false } });

@iranadryan
Copy link
Author

I put as false and it contiues putting a \n

@ankon
Copy link
Contributor

ankon commented May 6, 2020

Which version of PptxGenJS are you using?

@Offbeatmammal
Copy link

Offbeatmammal commented May 13, 2020

I am using the CDN version https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@latest/dist/pptxgen.min.js

I have a similar issue ... not specifying blankLine is putting a single linebreak between adjacent items in the array, putting blankLine either as true or false adds an extra one

looks like #369 already addresses this?

@bonavida
Copy link

bonavida commented May 13, 2020

This is not working either when you use word-level formatting inside table cells.

// Example
var arrObjText = [
    { text: 'Red ', options: { color: 'FF0000', breakLine: false } },
    { text: 'Green ', options: { color: '00FF00', breakLine: true } },
    { text: 'Blue', options: { color: '0000FF' } }
];
slide.addText(arrObjText, {});

outputs

Red
Green
Blue

instead of

Red Green
Blue

Any reason why, @gitbrent?

@gitbrent
Copy link
Owner

While there continues to be issues under development with using align sometimes, this particular example works as designed (v3.2.0):

var pptx = new PptxGenJS();
var slide = pptx.addSlide();

slide.addText(
    [
        { text: "Red ", options: { color: "FF0000", breakLine: false } },
        { text: "Green ", options: { color: "00FF00", breakLine: true } },
        { text: "Blue", options: { color: "0000FF" } },
    ],
    { x: 1, y: 1, w: "80%", h: 3, fill: pptx.SchemeColor.background2 }
);

pptx.writeFile("PptxGenJS-Issue-730");

Screen Shot 2020-05-23 at 23 04 55

@Offbeatmammal
Copy link

hopefully the align: issues can be addressed at some point ... I have a specific example where based on a template we have a textbox which is align:center to position titles appropriately, but if there is formatting in the line (eg one word bolded) then this issue causes extraneous linebreaks to appear.

@iranadryan
Copy link
Author

Which version of PptxGenJS are you using?

^3.1.1

@gitbrent
Copy link
Owner

FYI: Fixed via Issue #751

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

5 participants