[
https://issues.apache.org/jira/browse/TIKA-5073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149868#comment-18149868
]
ASF GitHub Bot commented on TIKA-5073:
--------------------------------------
shihchengwei-lab commented on PR #3654:
URL: https://github.com/apache/tika/pull/3654#issuecomment-7105708451
At `212f9f2`, toggling `detectSuperscriptSubscript` on the same tagged PDF
changed the space count between `1` and `B` in `ToTextContentHandler`’s output:
```text
off: "Article 1 B"
on: "Article 1 B"
```
The test writes `Article `, a superscript `1`, and a literal trailing space
in one `P`. It then writes `x y` inside an `/Artifact` and resumes the same `P`
with `B`. Both runs used the tagged path with zero fallback pages. With
detection on, the XHTML correctly contains `<sup>1</sup>`.
Could `endsWithSeparator()` recognize the trailing space consistently
whether it shares a text chunk with `1` or sits in its own chunk?
I used AI to help trace the difference and run the test.
> Keep superscript/subscript as sup/sub in pdf
> --------------------------------------------
>
> Key: TIKA-5073
> URL: https://issues.apache.org/jira/browse/TIKA-5073
> Project: Tika
> Issue Type: Improvement
> Reporter: Dylan Hoh
> Priority: Minor
>
> TIKA-5016 added sup/sub output for Office formats, but PDFs don't record
> superscript/subscript, so "Article 5¹" comes out as "Article 51". It can be
> guessed from smaller text sitting above or below the line, so this would be
> an opt-in setting, off by default.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)