Bug 114769 - Relative URL lost after Save as HTML (Export as HTML works)
Summary: Relative URL lost after Save as HTML (Export as HTML works)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.7.2 release
Hardware: All All
: medium normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.5.0 target:7.4.2 target:7.3.7
Keywords: bibisected, bisected, regression
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2017-12-30 14:03 UTC by Hans van Buitenen
Modified: 2022-09-05 12:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example ODT (31.86 KB, application/vnd.oasis.opendocument.text)
2017-12-30 14:11 UTC, Hans van Buitenen
Details
Screenshots on linux and W10 (674.56 KB, application/zip)
2017-12-30 17:13 UTC, Hans van Buitenen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans van Buitenen 2017-12-30 14:03:34 UTC
Description:
Recently i upgraded from 4.3 to the last stable version. 5.3.7.2
I an used to doing the following:
 - Create an ODT document
 - Create an HTML Link
 - Edit the link manually by replacing it with a relative path
 - Save the document
 - Save as to HTML
After this, the url is lost. If i then open the document with quanta, a text-based html editor, then the url is an empty string: ""
This can be repeated,
Waht is remarcable, is that already existing html links are not affected during the export to html.


Steps to Reproduce:
 - Create an ODT document
 - Create an HTML Link
 - Edit the link manually by replacing it with a relative path (for upload)
 - Save the document
 - Save as to HTML

Actual Results:  
The links has no url

Expected Results:
The url should have been preserved


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: no


User-Agent: Mozilla/5.0 (X11; Linux i686; rv:57.0) Gecko/20100101 Firefox/57.0
Comment 1 Hans van Buitenen 2017-12-30 14:11:51 UTC
Created attachment 138748 [details]
Example ODT

Open the document
Search for "boeken over vaccinatie"
Edit the URL
file:///home/hans/data/web/christelijke-antwoorden.nl/Books/Index-Vaccinatie.html
Change it to "../Books/Index-Vaccinatie.html"
Save the doc,
save it to html
check the resulting document.
In my case the relative path is an existing location so that might affect the result.
Comment 2 Dieter 2017-12-30 15:18:19 UTC
I treid to reproduce it with Windows and LO 5.4.4. I opened your attachment and saved it as html. I opened it with Firefox and the URL was still there. So could it be a bug of your html editor? What results do you get with other editors? And of course, perhaps it's only a LINUX problem.

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the problem still exists in with other editors.

I used

Version: 5.4.4.2 (x64)
Build-ID: 2524958677847fb3bb44820e40380acbe820f960
CPU-Threads: 4; BS: Windows 6.19; UI-Render: Standard; 
Gebietsschema: it-IT (de_DE); Calc: group
Comment 3 Hans van Buitenen 2017-12-30 17:11:36 UTC
Hi, i repeated the test and opened the html with kedit,
the same result.
Then i repeated the test om my W10 laptop
wich has a slightly older version of LOffice,
again the same result.

I creates some screenshots where >=20 are made on windows
See the attachments
Comment 4 Hans van Buitenen 2017-12-30 17:13:38 UTC
Created attachment 138751 [details]
Screenshots on linux and W10
Comment 5 Buovjaga 2018-01-27 18:50:11 UTC
Only seen with "Save as", "Export" works correctly.

Luckily it is a regression as it works in 3.6.

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: 2d8f17565ebe867210f5769851d91b2e7b612a8f
CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on January 27th 2018

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 6 Buovjaga 2018-05-31 18:25:05 UTC
Using steps from comment 1, bisected to https://cgit.freedesktop.org/libreoffice/core/commit/?id=0706b5756e06b7773a78e3046a47efc2c81d92b1

commit 0706b5756e06b7773a78e3046a47efc2c81d92b1 (patch)
tree 20f29c5e5c4cd4d12af870994312cf38f98b1736
parent 87a5cf7db1f070cbc4a674a1c12c805a2c950856 (diff)
tdf#76291 write encoded URL as href in html output
INetURLObject class is used to create correctly encoded URL

Change-Id: Icc9e71e848fd8a0b487f74232b9ad3e7ddde50b4

Done using bibisect-win32-5.0

Adding Vasily to CC
Comment 7 Xisco Faulí 2018-06-05 18:58:33 UTC
Adding Cc: to Vasily Melenchuk
Comment 8 QA Administrators 2019-06-06 02:53:36 UTC Comment hidden (obsolete)
Comment 9 Hans van Buitenen 2019-07-12 15:45:45 UTC
The error has been reproduced on LibreOffice 6.2.2.2 (Linux)
See https://youtu.be/_8Hq7QHq780
Comment 10 Hans van Buitenen 2019-07-12 16:51:51 UTC
Tested on LibreOffice 6.3.0.1 (Linux)
Same behaviour
See https://youtu.be/QgRHpas-rxU

Version: 6.3.0.1
Build ID: 41ac97386aba908b6db860cfb4cfe2da871886ae
CPU threads: 2; OS: Linux 4.9; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 11 Commit Notification 2022-08-30 07:31:04 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/599da3fa69805ebf8dee4517855fd8706e19d11d

tdf#114769: sw html export: better handling for relative URLs

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2022-08-31 01:49:47 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/184a9eec62058dcbe185d74cfd40a3772d3b801d

tdf#114769: sw html export: better handling for relative URLs

It will be available in 7.4.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2022-09-05 12:44:51 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/f5003b9b1b44a16e28b1c3080d11347e5b365e1e

tdf#114769: sw html export: better handling for relative URLs

It will be available in 7.3.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.