gitbrent / PptxGenJS

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

[BUG] Hyperlink on Image does not work with Special Character like & #1239

Open thisisyongsiang opened 1 year ago

thisisyongsiang commented 1 year ago

We appreciate your feedback - to help the team understand your needs please complete the following template to ensure we have the details to help.

Submission Guidelines

Issue Category

Product Versions

pptxgenjs: "3.12.0", ppt: "Microsoft® PowerPoint® for Microsoft 365 MSO (Version 2303 Build 16.0.16227.20202) 64-bit" running on node

Desired Behavior

Expect Hyperlink with any kind of characters to be properly added to image.

Observed Behavior

Currently If hyperlink with "&" character is added to an image, it would cause the final ppt document to display the message of "Powerpoint found a problem with content in ..." when opened.

Steps to Reproduce

Use this following code:

    slide.addImage({
      hyperlink:{url:"https://google.com/hi&"},
      w: 1,
      h: 1,
      path: <<someimagePAth>>,
      y: 0,
      x: 0,
    });
thisisyongsiang commented 1 year ago

current work around will be to use hyperlink:{url:encodeURIComponent(link)} instead