You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "yakivy (via GitHub)" <gi...@apache.org> on 2023/12/26 12:42:53 UTC
[PR] Fix html parsing logic when body contains script tag [tika]
yakivy opened a new pull request, #1522:
URL: https://github.com/apache/tika/pull/1522
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Hey there. I spotted that public signup to Tika Jira is disabled, so I'm not sure what is the correct flow for issues without a ticket, putting all related info here...
### Issue description
`org.apache.tika.parser.html.JSoupParser` parser ignores `body` content after the `script` tag. Check `org.apache.tika.parser.html.HtmlParserTest#testScriptInBody` test for details.
### Fix description
The main reason of such behaviour is that `#data` tag tail decrements `org.apache.tika.parser.html.HtmlHandler.bodyLevel`, when `#data` tag head is considered a content node and doesn't invoke `startElement` logic at all. As a fix I mirrored head logic for the data node to the tail and returned `FilterResult.CONTINUE` early.
--
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: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix html parsing logic when body contains script tag [tika]
Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison merged PR #1522:
URL: https://github.com/apache/tika/pull/1522
--
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: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix html parsing logic when body contains script tag [tika]
Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on PR #1522:
URL: https://github.com/apache/tika/pull/1522#issuecomment-1874087461
Thank you @yakivy!
--
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: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org