[Bug] Hyperlink with a # part is read back without its target
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start at HyperlinkTagHandler.startElement and reproduce the issue with extraHyperlinkFragment.xlsx, focusing on hyperlinks that contain both location and r:id. Verify the external target and fragment are combined into the returned address, while internal links still use location alone; confirm the expected addresses for both examples.
Written by the indexing model from the issue text.
Description
Search before asking
- I searched in the issues and found nothing similar.
Fesod version
main
JDK version
any
Operating system
Linux
Steps To Reproduce
Open an .xlsx whose cell A1 links to an external URL that has a fragment,
e.g. https://example.com/page#section.
<!-- xl/worksheets/sheet1.xml -->
<hyperlink ref="A1" r:id="rId1" location="section" display="frag"/>
<hyperlink ref="A2" r:id="rId2" display="plain"/>
<!-- xl/worksheets/_rels/sheet1.xml.rels -->
<Relationship Id="rId1" Target="https://example.com/page" TargetMode="External" Type=".../hyperlink"/>
<Relationship Id="rId2" Target="https://example.com/plain" TargetMode="External" Type=".../hyperlink"/>
Current Behavior
[section, https://example.com/plain]
The fragment is reported as if it were a link inside the workbook, and the URL https://example.com/page is lost.
The same happens to a link to a cell in another workbook, other.xlsx#Sheet1!A1, which is stored the same way:
<hyperlink ref="A1" r:id="rId1" location="Sheet1!A1"/>
<Relationship Id="rId1" Target="other.xlsx" TargetMode="External" Type=".../hyperlink"/>
It is read back as Sheet1!A1, which looks like a link to a cell in the workbook being read.
Expected Behavior
[https://example.com/page#section, https://example.com/plain]
and other.xlsx#Sheet1!A1 for the other-workbook link. This is what POI returns for the same files (XSSFHyperlink.getAddress()).
Anything else?
HyperlinkTagHandler.startElement treats location and r:id as either/or: when location is present it reports it and returns before resolving r:id. That is right for links inside the workbook, which only carry location, but an external link with a # part carries both.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 532
- Avg merge
- 22h 29m
- Merged PRs (30d)
- 25
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/fesod
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/fesod#1131 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
[bug]Custom converters with supportExcelTypeKey() == null are silently ignored when writing CSVOpen
Difficulty 2/5 Half a day Newbie friendliness 84/100
Maintainers usually reply within 1 day
Similar issues
-
and-bugs and-ui gpx-track
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
TerminalRow.mSpaceUsed (short) overflows on terminals wider than 1023 columns, crashing setCharOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
termux/termux-app#5340 ·
Maintainers usually reply within 1 day
-
OpenAICompatibleToolDescriptorSchemaGenerator drops requiredProperties of nested object parametersOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
apache/rocketmq-dashboard#5110 ·
Maintainers usually reply within 1 day
-
frontend
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
No-Country-simulation/S08-26-equipo04#210 ·
Maintainers usually reply within 1 day