Cross reference from HTML anchor to PDF document?

What is the most efficient way to take an HTML document that has HTML anchors and links to them in it and then transfer that content to a LibreOffice Writer document, and then export it as a PDF with characters that can be clicked to achieve the same “jump-to-linking” of the anchors within the exported PDF document?

For example, in my generated HTML document I’d have at one spot something like this:

   <span id="1_1"> some bunch of text
      <sup><a href="#1">1</a></sup>
   </span> 

and at another spot further down the page, something like this:

  <span id="1">some related text</span><sup><a href="#1_1">1</a></sup>

and they would link back and forth…

I looked at the Cross-References documentation and the closest thing that I got was to copy it out of Firefox 57, and paste it into Libre Writer, and then for each and every single link:

  1. Manually remove each anchor hyperlink…
  2. Replace that with a set reference.
  3. Then Insert a reference
  4. Update all the references

…and then finally export the document as a PDF with “Convert document references to PDF targets” checked (in the “PDF Options” tab under “Links”) as well as the “Open with PDF reader application” radio button selected.

There must be a more efficient way to do this; it takes forever to repeat the above steps, and I am using a computer after all.

How is this question related to the one you asked at Convert Anchor hyperlinks to references automatically?? It does not seem that you have provided any response to the answer given there.