Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlink support #84

Open
manveru opened this issue Mar 19, 2019 · 0 comments
Open

Hyperlink support #84

manveru opened this issue Mar 19, 2019 · 0 comments

Comments

@manveru
Copy link

manveru commented Mar 19, 2019

I need to support hyperlinks. I'm thinking of making a PR for it, but this will probably take a while and I'm not sure how to support cells that contain hyperlinks and normal text at the same time (though I don't personally need it, that seems allowed in the spec).

For anyone looking for a quick fix, you can use the HYPERLINK function like [{:formula, "HYPERLINK(\"#{url}\", \"#{url}\")"}].

So for now I'll just leave this issue here of how they look like in the XLSX:

In the sheet$n.xml row, the hyperlink is referenced via r, like r=C8.
In the sheet$n.xml, in the <workbook/> tag this section:

<hyperlinks>
  <hyperlink ref="C8" r:id="rId1" display="http://example.com"/>
</hyperlinks>

In worksheets/_rels/sheet$n.xml.rels is this content:

<?xml version="1.0" encoding="UTF-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="http://example.com" TargetMode="External"/>
</Relationships>

I'm not entirely sure how the code for a cell should look like, given that hyperlinks can be mixed with other content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant