gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
2.62k stars 611 forks source link

[Question] Is it possible to have a text hyperlink just in part of the text? #1326

Open i23098 opened 2 months ago

i23098 commented 2 months ago

Issue Category

Product Versions

Desired Behavior

I would like to have an email link in the middle of a sentence

Observed Behavior

Adding a hyperlink to the text makes the entire text a link

Steps to Reproduce

import PptxGenJS from 'pptxgenjs';

const pptx = new PptxGenJS();
pptx.layout = 'LAYOUT_4x3';

const slide = pptx.addSlide();
slide.addText("Contact support@company.com if you need help.", {
  x: 0.75, y: 4.25,
  w: 8.5, h: 0.35,
  fontSize: 14,
  hyperlink:{url:'mailto:support@company.com'}
});

pptx.writeFile({fileName: 'email-link.pptx'});

There should be a way (if there is, couldn't find it) to specify the hyperlink just on some word(s).