4 Replies Latest reply on Jun 8, 2017 3:18 AM by TᴀW

    HTML export: Losing #anchor in hyperlink URLs

    lilis_skyremix

      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!

        • 2. Re: HTML export: Losing #anchor in hyperlink URLs
          TᴀW Adobe Community Professional & MVP

          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

          • 3. Re: HTML export: Losing #anchor in hyperlink URLs
            lilis_skyremix Level 1

            @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.

            • 4. Re: HTML export: Losing #anchor in hyperlink URLs
              TᴀW Adobe Community Professional & MVP

              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:

               

              capture.png

               

              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

              1 person found this helpful