Bug 66036 - FILESAVE: mathematical formulas are lost when saving HTML pages
Summary: FILESAVE: mathematical formulas are lost when saving HTML pages
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-22 08:57 UTC by Frédéric Wang
Modified: 2014-01-25 14:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample output (515 bytes, text/html)
2013-06-22 08:58 UTC, Frédéric Wang
Details
Expected output (734 bytes, text/html)
2013-06-22 08:59 UTC, Frédéric Wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang 2013-06-22 08:57:09 UTC
Step to reproduce:

1) File => New => HTML Document
2) Insert => Object => Formula
3) In the bottom frame, type "x over y"
4) Click on the top frame to go back to the HTML editor. You should see a fraction x over y.
5) Save the file

You get an error message "Warning saving the document ***: Write Error. Document could not be completely saved.". The HTML page is saved but is empty. The same issue happens with the Word Processor if you do "save as => HTML Document".

Note however that the Word Processor is able to open and save ODT documents with mathematical formulas, and they are encoded as MathML. With HTML5 parsers, browsers are now able to process MathML inside HTML documents. Hence the HTML editor should insert the MathML code of formulas into the HTML output.
Comment 1 Frédéric Wang 2013-06-22 08:58:18 UTC
Created attachment 81196 [details]
Sample output
Comment 2 Frédéric Wang 2013-06-22 08:59:59 UTC
Created attachment 81197 [details]
Expected output

You can open this in a browser with MathML support e.g. Firefox.
Comment 3 Regina Henschel 2013-06-22 09:59:02 UTC
Save to HTML exports to "HTML 4.0 Transitional", which is not able to include MathML. Please use a normal (not Web) Writer document and then the export filter XHTML.

The HTML export filter had saved the pictures of the formulas and linked to them. The picture is still generated, but the link is missing in  4.1.0.0.beta2
Build ID: 33224f4f11a05cfad2249e812fcc2975fbb61f6.

So this is a real bug.

Please write a new enhancement request, if you want to get a HTML5 export filter.
Comment 4 Frédéric Wang 2013-06-22 10:36:19 UTC
Thanks for mentioning the XHTML export. I've opened bug 66044.
Comment 5 Frédéric Wang 2013-06-27 22:55:32 UTC
(In reply to comment #3)
> Please use a normal (not Web) Writer document and then the
> export filter XHTML.

When I do that I get both the <math> element and and <img src="data:image/*;..."> image (which is not displayed and creates a new line). Is it a bug and should only the <math> element be exported?

(the <math> element has an altimg attribute in MathML3, but I don't think any browser supports that)
Comment 6 Frédéric Wang 2013-06-30 13:27:19 UTC
(In reply to comment #5)
> When I do that I get both the <math> element and and <img
> src="data:image/*;..."> image (which is not displayed and creates a new
> line). Is it a bug and should only the <math> element be exported?
> 
> (the <math> element has an altimg attribute in MathML3, but I don't think
> any browser supports that)

Just to follow-up I've fixed that in my commit to export MathML code for display/inline mode: https://gerrit.libreoffice.org/#/c/4607/.
Comment 7 Jean-Baptiste Faure 2013-11-27 21:43:38 UTC
Hi, what is the status of this bug since the release of the beta-1? According to comment #6 it seems at least partially fixed.

Best regards. JBF
Comment 8 Jean-Baptiste Faure 2014-01-25 14:58:36 UTC
I tested the steps to reproduce from the bug description with version 4.2.0.3.0+ and it works like a charm (no error message and html file opened in Firefox)

Set to Resolved / Fixed due to comment #6
Thank you very much