5

I already know how to add links via Bookmarks and Table of Contents. I also know how to directly link to a header

However, rather than pasting the entire URL for the header, which creates an absolute link to that specific Google Doc, I want to just paste the fragment (#header=h.abc123xyz). This has the benefit of being document relative, in the sense that if someone makes a copy of my document, saves it as an HTML page, etc. (thus changing the URL), the anchor will still work as expected in the new document. Currently, it would just link to the section of the original document.

Is this possible?

Note: I've tried just pasting the fragment in the regular Insert Link dialog, but Google thinks it's an invalid URL. Is there a workaround? Am I doing it wrong?

1 Answer 1

3

If I click Insert / Link... and put in #header=h.abc123xyz, when I save it as an HTML document it is converted to #h.abc123xyz and it works as expected.

1
  • 1
    Yes, since I asked the question they apparently allowed this behavior. In fact, when you now choose "Insert Link" (CTRL+K) it gives you a dropdown to select section headers, which then inserts the #heading... thing.
    – drzaus
    Sep 23, 2013 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.