Bug 108491 - XHTML export puts inline formulae on separate lines (not with save-as)
Summary: XHTML export puts inline formulae on separate lines (not with save-as)
Status: RESOLVED DUPLICATE of bug 118637
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: (X)HTML-Export Formula-Object
  Show dependency treegraph
 
Reported: 2017-06-12 22:17 UTC by Shmuel (Seymour J.) Metz
Modified: 2021-06-29 13:04 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Document contining inline formulae (69.13 KB, application/vnd.oasis.opendocument.text)
2017-06-12 22:17 UTC, Shmuel (Seymour J.) Metz
Details
Screen capture of Export drop-down menu (1.33 MB, image/bmp)
2017-06-26 18:56 UTC, Shmuel (Seymour J.) Metz
Details
Exported XHTML with broken inline formula (3.12 KB, text/html)
2018-07-06 17:05 UTC, Shmuel (Seymour J.) Metz
Details
ODT file for which EXPORT generated bad HTML (10.30 KB, application/vnd.oasis.opendocument.text)
2018-07-06 17:07 UTC, Shmuel (Seymour J.) Metz
Details
Comparison Libo 4.1 ( left ), Libo 4.4 ( right-top ) and Libo 6.2 ( right-bottom ) (26.36 KB, image/png)
2018-07-09 14:30 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shmuel (Seymour J.) Metz 2017-06-12 22:17:32 UTC
Created attachment 133988 [details]
Document contining inline formulae

When I have inline formula objects in Writer  and export the entire document as XHTML, Writer puts each formula on a separate line when viewed from Firefox. I tried manually changing every occurrence of "block" to "inline", but still got extraneous line breaks.

If I export to PDF then I get the corrected results; the formulae are set off with white space but not with line breaks.

Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
Comment 1 Regina Henschel 2017-06-12 23:55:22 UTC
You need to set the following <div> elements to inline display too.

The problem is not only in the XSLT, but the object itself has already a display="block" attribute in the ODF file format. If you use "Textmode" for the formula, then it is exported without the display attribute, which then defaults to "inline". But the problem with the following div-element remains.
Comment 2 Jacques Guilleron 2017-06-15 09:53:29 UTC
Except specific need, did you try to save this file to html format?
Comment 3 Shmuel (Seymour J.) Metz 2017-06-15 19:22:05 UTC
I used export to HTML because I assumed that it would render faster than the PDF that http://mason.gmu.edu/~smetz3 currently uses. Are you suggesting File instead of Export?
Comment 4 Buovjaga 2017-06-23 17:06:30 UTC
(In reply to Shmuel (Seymour J.) Metz from comment #3)
> I used export to HTML because I assumed that it would render faster than the
> PDF that http://mason.gmu.edu/~smetz3 currently uses. Are you suggesting
> File instead of Export?

Yep, Save as.
Comment 5 Shmuel (Seymour J.) Metz 2017-06-26 18:56:34 UTC
Created attachment 134297 [details]
Screen capture of Export drop-down menu

Note that the XHTML option exists only for Export, not for Save as.
Comment 6 Buovjaga 2017-06-27 09:05:26 UTC
(In reply to Shmuel (Seymour J.) Metz from comment #5)
> Created attachment 134297 [details]
> Screen capture of Export drop-down menu
> 
> Note that the XHTML option exists only for Export, not for Save as.

I know, but it doesn't matter. Please try Save as HTML.
Comment 7 Shmuel (Seymour J.) Metz 2017-06-27 15:03:29 UTC
File -> Save as -> HTML gives me a warning that content may be lost, then puts each formula on a separate line - the same problem as for Export -> XHTML.
Comment 8 Buovjaga 2017-06-27 15:12:25 UTC
Ok, NEW per comment 1.
Comment 9 Shmuel (Seymour J.) Metz 2017-06-27 15:37:49 UTC
Whoops! I erroneously opened the XHTML file. The HTML file from File -> Save as -> HTML has a PNG rather than MATHML. Sorry for the blunder.
Comment 10 QA Administrators 2018-06-28 02:47:03 UTC Comment hidden (obsolete)
Comment 11 Shmuel (Seymour J.) Metz 2018-07-06 16:42:49 UTC
The problem does not occur with LibreOffice 6.0.4.2
Comment 12 Buovjaga 2018-07-06 16:49:19 UTC
Hey, that's pretty cool. Let's close.
Comment 13 Shmuel (Seymour J.) Metz 2018-07-06 17:02:04 UTC
(In reply to Shmuel (Seymour J.) Metz from comment #11)
> The problem does not occur with LibreOffice 6.0.4.2

Sorry, I was testing for a different problem. The formula still appears on a separate line, massively indented, and the text following it does not appear at all.
Comment 14 Shmuel (Seymour J.) Metz 2018-07-06 17:05:17 UTC
Created attachment 143361 [details]
Exported XHTML with broken inline formula
Comment 15 Shmuel (Seymour J.) Metz 2018-07-06 17:07:56 UTC
Created attachment 143362 [details]
ODT file for which EXPORT generated bad HTML

This reflects test on 6.0.4.2
Comment 16 Xisco Faulí 2018-07-09 13:37:24 UTC Comment hidden (obsolete)
Comment 17 Buovjaga 2018-07-09 14:13:53 UTC
Repro with attachment 133988 [details] and attachment 143362 [details]

Xisco: are you sure you were using Export and not Save as? Save as gives me inline formulas.
Comment 18 Regina Henschel 2018-07-09 14:15:34 UTC
I see the error in Version: 6.1.0.0.beta2+ (x64)
Build ID: 67a56897ec1e4f2bab2c3291b8dd225710d2ae29
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@62-TDF, Branch:libreoffice-6-1, Time: 2018-06-29_13:19:46
Locale: de-DE (en_US); Calc: CL

The formula is on a new line and the text after the formula is missing.
Comment 19 Xisco Faulí 2018-07-09 14:30:03 UTC
Created attachment 143395 [details]
Comparison Libo 4.1 ( left ), Libo 4.4 ( right-top ) and Libo 6.2 ( right-bottom )
Comment 20 Xisco Faulí 2018-07-09 14:30:44 UTC
Adding bibisectRequest to see when the different changes happened.
Comment 21 Xisco Faulí 2018-07-09 14:39:03 UTC
Created bug 108491 for the missing text after the formula
Comment 22 Buovjaga 2018-07-09 17:02:26 UTC
(In reply to Xisco Faulí from comment #19)
> Created attachment 143395 [details]
> Comparison Libo 4.1 ( left ), Libo 4.4 ( right-top ) and Libo 6.2 (
> right-bottom )

The first change is
commit 3e33318cd2f00d8aa029904490772c0dcaf715fe
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Sep 5 18:52:31 2015 +0800

    source-hash-1ef63d0842dab4154c5ca2fc42e416950bd7459a
    
    commit 1ef63d0842dab4154c5ca2fc42e416950bd7459a
    Author:     Frédéric Wang <fred.wang@free.fr>
    AuthorDate: Fri Jun 28 17:07:11 2013 +0200
    Commit:     Bosdonnat Cedric <cedric.bosdonnat@free.fr>
    CommitDate: Mon Jul 1 13:41:35 2013 +0000
    
         fdo#66278 - MathML export: distinguish inline/display equations.
Comment 23 QA Administrators 2019-07-10 02:53:56 UTC Comment hidden (obsolete)
Comment 24 Stéphane Guillou (stragu) 2021-06-29 12:58:13 UTC
Happy to report that the export looks good to me with:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: f446a203fa2897bab8ae7686c948a8bf060675c6
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-24_15:16:38
Calc: threaded

and:

Version: 7.2.0.0.beta1 / LibreOffice Community
Build ID: c6974f7afec4cd5195617ae48c6ef9aacfe85ddd
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

LO 7.0.6 and 7.1.4 export formulae on separate lines, so I assume the fix happened in the 7.2 branch development.
Comment 25 Xisco Faulí 2021-06-29 13:04:10 UTC
likely fixed by https://cgit.freedesktop.org/libreoffice/core/commit/?id=06eb655e2c83df8eeeb0c0828f8ac34f13e386af.
Closing as dupe of bug 118637. it should be fixed in LibreOffice 7.1.5

*** This bug has been marked as a duplicate of bug 118637 ***