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. > ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
