Copilot commented on code in PR #3172:
URL: https://github.com/apache/tika/pull/3172#discussion_r4012973500


##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/parser/pdf/PDFMarkedContent2XHTML.java:
##########
@@ -1467,20 +1468,11 @@ private ElementSpec spec(StructureIndex.Node node) {
             chain.add(n);
         }
         for (int i = chain.size() - 1; i >= 0; i--) {
-            chain.get(i).spec = buildSpec(chain.get(i));
+            chain.get(i).spec = buildSpec(chain.get(i), new AttributesImpl());

Review Comment:
   Removing this fallback broadens the PDFBox compatibility fix into a 
regression for malformed tagged PDFs. `mapType` still invokes several PDFBox 
accessors besides `/Headers` (for example element language/title and table 
span/scope); if any throws, the exception now escapes structure-tree emission 
instead of rebuilding the element without optional attributes as before. Keep 
the catch-and-rebuild guard while bypassing only `getHeaders()`.
   
   This issue also appears on line 1693 of the same file.



-- 
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]

Reply via email to