Skip to main content
lilis_skyremix
Participant
June 8, 2017
Question

HTML export: Losing #anchor in hyperlink URLs

  • June 8, 2017
  • 3 replies
  • 597 views

Hi,

We've been trying to export HTML from InDesign files, which on most cases works properly.

But, there's an issue with #anchors in hyperlink URLs.

For example, if the hyperlink URL is http://example.com/test.html#heading1, I expected the export result would be like below:

<a href="http://example.com/test.html#heading1">Link text</a>

However, the actual result is like below:

<a href="#heading1">Link text</a>

, losing the base URL altogether.

Is there any method to solve this? It puts quite some bit of workload on our team, to manually fix all the hyperlinks.

Any help would be appreciated.

Thanks!

This topic has been closed for replies.

3 replies

lilis_skyremix
Participant
June 8, 2017

@Eugene, @TaW,

Thanks for your suggestions.

About in5, we do not intend to keep the InDesign layout as is, which I think your product is aiming for. For us, HTML export is a stepping stone so our XSLT can work with.

About Hyperlink Pro, it seems to be useful when generating URLs inferred from text itself, which unfortunately we do not.

As TaW pointed out, I haven't described the workflow enough, so here it is.

1. URLs are inserted via InDesign native feature, the Hyperlink panel. When exported to PDF, the hyperlinks work perfectly. The hyperlinks are embedded manually, to make sure correct settings are set.

2. We export to HTML via the InDesign native feature where URLs are automatically changed to HTML links, which URLs with # results in error I've described above.

Any help is appreciated.

TᴀW
Legend
June 8, 2017

I'm not seeing this issue with ID2015 on Windows. If I select text in InDesign, open the Hyperlinks panel, add the URL

http://example.com/test.html#heading1

to the selected text, and then export to HTML, the link comes through fine, as you can see in the following screenshot:

Another thing I would mention is that even if the URLs seem fine in Acrobat (which would lead you to believe that they are correctly inputted in InDesign) that is not necessarily the case. Acrobat has its own URL algorithm, and if it sees something in the text that looks like a URL, it will convert it to one. And its algorithm is better than InDesign's, it would seem.

My recommendation is that you check again in the hyperlinks panel whether the URLs have been properly inputted.

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
TᴀW
Legend
June 8, 2017

You don't describe your workflow in much detail. I presume you're (a) using InDesign's feature for converting URLs to hyperlinks? (Type > Hyperlinks > Convert URLs to Hyperlinks) and then (b) exporting as HTML?

Apart from Eugene's suggestion, you could also try our: Hyperlink Pro | Id-Extras.com

I tried it on your sample text, and it incorrectly includes the quote marks -- however that can be corrected (I just need to make sure that quote marks are indeed always illegal in a URL -- looks so...)

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
Community Expert
June 8, 2017

Try AJAR Productions Ajar Productions: in5 - Home