[
https://issues.apache.org/jira/browse/TIKA-5071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18148444#comment-18148444
]
ASF GitHub Bot commented on TIKA-5071:
--------------------------------------
DylanSYHoh commented on PR #3648:
URL: https://github.com/apache/tika/pull/3648#issuecomment-7054464490
> My 🤖 finds these. Let me know what you think?
>
> ```
> Findings
> 1. Quadratic join, repeated per cell. ScriptedTextCell.append joins
same-tag runs by string concatenation.
> - .xls: a shared string can carry 65,535 one-character runs, and
toScriptedText re-sorts and re-joins it for every LabelSST cell that references
it.
> - .xlsx: the run count is unbounded, and the join is also redone per
cell.
> - A small file can burn CPU before any output limit triggers. Fix: a
StringBuilder per run, and merge once per shared string rather than per cell.
> 2. Cell font overrides explicit runs. When the cell's font is sup/sub
and the rich-text runs make the text plain, the whole cell is still wrapped.
> - .xls: toScriptedText returns null, and the fallback addTextCell
re-applies the cell tag.
> - .xlsx: scripted == null && cellScriptTag != null in outputCell does
the same whenever no run has vertAlign. A sup cell holding one no-rPr run "a"
and one bold run "b" comes out <sup>ab</sup> instead of
> <sup>a</sup>b.
> 3. Text dropped in .xlsx. <si><t>abc</t><r>…superscript…</r></si> is
schema-valid, but only text inside <r> reaches runText. "abc" disappears from
the output of every cell using that string. Fix: fall back to the
> plain string when the runs don't cover it.
> ```
> Keep superscript/subscript as sup/sub in xls and xlsx
> -----------------------------------------------------
>
> Key: TIKA-5071
> URL: https://issues.apache.org/jira/browse/TIKA-5071
> Project: Tika
> Issue Type: Improvement
> Reporter: Dylan Hoh
> Priority: Minor
>
> TIKA-5016 added sup/sub output for docx, pptx, doc, RTF and HTML, but Excel
> files still lose it, so "Hâ‚‚O" in a cell comes out as "H2O". The formatting is
> available in both xls and xlsx, in the shared strings' rich-text runs and in
> the cell font.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)