Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/officecli/Handlers/Excel/ExcelHandler.Helpers.Cell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ private string GetCellDisplayValue(Cell cell, Core.FormulaEvaluator? evaluator =
if (sst?.SharedStringTable != null && int.TryParse(value, out int idx))
{
var item = sst.SharedStringTable.Elements<SharedStringItem>().ElementAtOrDefault(idx);
return item?.InnerText ?? value;
if (item != null)
{
// CT_Rst.InnerText also includes <rPh> phonetic-guide text.
// That text annotates the base value; it is not part of the
// ordinary cell content. Read only the direct <t> value or
// rich-text <r><t> runs, while BuildCellNode continues to
// expose the guide separately as Format["phonetic"].
return item.Text?.Text
?? string.Concat(item.Elements<Run>().Select(r => r.Text?.Text ?? ""));
}
}
}

Expand Down