[ 
https://issues.apache.org/jira/browse/TIKA-1896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Allison updated TIKA-1896:
------------------------------
    Attachment: reports.tar.bz2

Reports on comparison of ~270k html/xhtml files.

The proposed modification was less exciting than I had originally proposed.  
This leaves the script as a cdata element:

{noformat}
    private class MySchema extends HTMLSchema {
        public MySchema() {
            super();
            ElementType elScript = getElementType("script");
            elScript.setFlags(getElementType("table").flags());
        }
    }
{noformat}

There are a few handfuls of really bad changes, and quite a few files with 
extra java script extracted where it shouldn't be.

Let me know what you think.

> Invalid closing script tag not handled gracefully by HtmlParser
> ---------------------------------------------------------------
>
>                 Key: TIKA-1896
>                 URL: https://issues.apache.org/jira/browse/TIKA-1896
>             Project: Tika
>          Issue Type: Improvement
>          Components: parser
>    Affects Versions: 1.12
>            Reporter: Matthew Caruana Galizia
>            Priority: Minor
>         Attachments: reports.tar.bz2, test.html
>
>
> When an HTML file contains an invalid closing script tag, all content after 
> that tag is interpreted as script data and therefore ignored.
> Reduced test case file attached.
> To reproduce:
> 1) create a file with the following HTML
> {code:html}
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
> "http://www.w3.org/TR/html4/loose.dtd";>
> <html>
>       <head>
>               <script lang="javascript"></script language>
>       </head>
>       <body>
>               <p>This is a test.</p>
>       </body>
> </html>
> {code}
> 2) {{java -jar tika-app-1.12.jar -t test.html}}
> Expected result:
> {{This is a test.}}
> What is actually returned:
> Nothing.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to