Skip to content

Commit 4cc640c

Browse files
committed
[fix] corrected hyperlink ID generation to start from 1 instead of 1000
1 parent 7254cdb commit 4cc640c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ fn get_sheet_data(
673673
for (i, h) in hyperlinks.iter().enumerate() {
674674
let mut hyperlink_el = Element::new("hyperlink");
675675
hyperlink_el
676-
.add_attr("r:id", format!("rId{}", 1000 + i))
676+
.add_attr("r:id", format!("rId{}", 1 + i))
677677
.add_attr("ref", &h.cell);
678678
hyperlink_children.push(hyperlink_el);
679679
}
@@ -728,7 +728,7 @@ fn get_sheet_rels(hyperlinks: &[Hyperlink]) -> String {
728728

729729
for (i, link) in hyperlinks.iter().enumerate() {
730730
let mut rel = Element::new("Relationship");
731-
rel.add_attr("Id", format!("rId{}", 1000 + i));
731+
rel.add_attr("Id", format!("rId{}", 1 + i));
732732
rel.add_attr("Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink");
733733
rel.add_attr("Target", &link.url);
734734
rel.add_attr("TargetMode", "External");

0 commit comments

Comments
 (0)