Bug 36080 - [Easy Hack] HTML import fails if title tag is self-closed
Summary: [Easy Hack] HTML import fails if title tag is self-closed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.2 release
Hardware: All All
: medium normal
Assignee: Anthony Durity
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks:
 
Reported: 2011-04-08 07:57 UTC by Nicolas Delaby
Modified: 2015-12-16 22:31 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
HTML file to import (243 bytes, text/html)
2011-04-08 07:57 UTC, Nicolas Delaby
Details
process unknown html tags better (1.46 KB, patch)
2011-04-19 05:10 UTC, Anthony Durity
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Delaby 2011-04-08 07:57:53 UTC
Created attachment 45422 [details]
HTML file to import

the following html document:
"""
<html>
  <head>
    <meta http-equiv="CONTENT-TYPE" content="text/html; charset=us-ascii"/>
    <title/>
    <meta name="GENERATOR" content="LibreOffice 3.3  (Unix)"/>
  </head>
  <body>
    <p lang="en-GB">Hello world!</p>
  </body>
</html>
"""

produce on LibreOffice UI this output.

"""
name="GENERATOR" content="LibreOffice 3.3  (Unix)"/ 
Hello world!
"""

It is caused by self-closed tag title( '<title/>' )
If you replace this tag by '<title></title>', it works.
Comment 1 Anthony Durity 2011-04-19 02:49:14 UTC
On further investigation, if the <title> tag has a space in it

"""
<title />
""""
then no output is shown whatsoever.
Comment 2 Anthony Durity 2011-04-19 05:10:21 UTC
Created attachment 45810 [details]
process unknown html tags better

This should fix this bug. Extraneous text is discarded in HEAD section.
Comment 3 Kohei Yoshida 2011-04-19 07:14:33 UTC
Hi Anthony,

Great work on fixing this.  Could you send a note to the developer list of your patch so that someone can take a look and review?  Thanks!
Comment 4 Cédric Bosdonnat 2011-04-22 04:09:28 UTC
Fixed by http://cgit.freedesktop.org/libreoffice/writer/commit/?id=a1be91f68d42f5da78947c9ceceec37fef5afb57 in master branch.
Comment 5 Robinson Tryon (qubit) 2015-12-16 22:31:17 UTC
Migrating Whiteboard tags to Keywords: (ProposedEasyHack -> needsDevEval)
[NinjaEdit]