Unexpected underline in HTML (1314)

Hi,

I’m adding a specific zero-width space character (\u200B) portion before and after each existing portion in the presentation. For some presentations, it works as expected (the added portion is not visible). But for some other, this portion gets underlined. Please see the attached screenshot underline.jpg (703.7 KB) and the source presentation file 1.ppt.zip (909.7 KB)

Here’s the code I use:

    private static final String ZERO_WIDTH_SPACE_CHARACTER = "\u200B";
    private static final String URL = "http://example.com/";

    public static void main(String[] args) {

	String filePath = args[0];
	String targetPath = args[1];

	Presentation presentation = new Presentation(filePath);

	ISlideCollection slides = presentation.getSlides();

	for (ISlide slide : slides) {

	    IShapeCollection shapes = slide.getShapes();

	    for (IShape shape : shapes) {

		if (shape instanceof IAutoShape) {

		    IAutoShape autoShape = (IAutoShape) shape;

		    IParagraphCollection paragraphs = autoShape.getTextFrame().getParagraphs();

		    for (IParagraph paragraph : paragraphs) {

			IPortionCollection portions = paragraph.getPortions();

			List<IPortion> temporaryPortions = new ArrayList<>();

			for (IPortion portion : portions) {
			    temporaryPortions.add(createHyperlinkPortion());
			    temporaryPortions.add(portion);
			    temporaryPortions.add(createHyperlinkPortion());
			}

			portions.clear();

			for (IPortion portion : temporaryPortions) {
			    portions.add(portion);
			}
		    }
		}
	    }
	}

	presentation.save(targetPath, SaveFormat.Html);

	presentation.dispose();
    }

    private static IPortion createHyperlinkPortion() {
	IPortion portion = new Portion(ZERO_WIDTH_SPACE_CHARACTER);
	portion.getPortionFormat().setHyperlinkClick(new Hyperlink(URL));
	return portion;
    }

Can you check this?

I’m using Aspose.Slides for Java 17.10.

Thanks,
Zeljko

@Zeljko,

I have worked with source code and presentation file shared by you using Aspose.Slides for Java 17.10 and have been able to observe the issue. A ticket with ID SLIDESJAVA-36661 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

@Zeljko,

Can you please share following details so that we may further investigate to help you out.

  • OS version.
  • JDK version.
  • List of font (if he uses Linux) (fc-list command).

OS version:

Ubuntu 16.04 x64

JDK version:

java version “1.8.0_144”
Java™ SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot™ 64-Bit Server VM (build 25.144-b01, mixed mode)

List of font (if he uses Linux) (fc-list command): font-list.txt.zip (6.4 KB)

@Zeljko,

Your feedback has been shared with product team. Thanks for sharing information with us.

The issues you have found earlier (filed as SLIDESJAVA-36661) have been fixed in Aspose.Slides for Java 18.1. Please try using the latest release version and in case you experience any issue or you have any further query, please feel free to contact.