We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to keep relative css/js link in html?

If I load a html file with Aspose.HTML, then save it to another file path, I notice that the relative css/js/img link in the html will change to absolute link.

e.g.
original link: …/…/test.js
link after saving: D:\test\test.js

I just want to modify some text in the html and leave everything else untouched. If the link changes and I move the html file to another place, the images and styles in the html will be invalid. That is a big trouble to me.

Is there any way or option to KEEP the original relative link?

Hi @davidknn,

Thanks for your question.
Could you please share your sample HTML with all content in .zip format. We will test the scenario in our environment and address it accordingly.

Could you also inform the version of Aspose.HTML that you have installed?

[]'s

html_test.zip (6.0 KB)

Please check the attachment. There are only one html file and one css file inside. Take it as an example.

Aspose.HTML version is 22.8.

Thank you!

@davidknn

Have you already tried to modify some text inside this HTML? Can you please share some sample code snippet with us as well that you tried so far? We will further proceed to assist you accordingly.