Bug 131278 - Hyperlink always starts in a new line, if it doesn't fit the line with text (ICU 60.1 change)
Summary: Hyperlink always starts in a new line, if it doesn't fit the line with text (...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: high enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 155088 (view as bug list)
Depends on:
Blocks: Anchor-and-Text-Wrap Hyperlink Authors ICU Word-Line-Break
  Show dependency treegraph
 
Reported: 2020-03-11 11:22 UTC by Ahiijny
Modified: 2024-05-10 11:56 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Doc file containing a URL that gets word-wrapped (23.50 KB, application/msword)
2020-03-11 11:22 UTC, Ahiijny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahiijny 2020-03-11 11:22:12 UTC
Created attachment 158600 [details]
Doc file containing a URL that gets word-wrapped

Version: 6.3.5.2 (x64)
Build ID: dd0751754f11728f69b42ee2af66670068624673
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-CA (en_CA); UI-Language: en-US
Calc: threaded

I was writing a report in MS Word, and it struck me as strange that the page count was different when I opened it in LibreOffice. I'd just nicely fitted all of my references on one page in Word, so it was a bit awkward to just have that one reference leaking onto a second page in LibreOffice.

I managed to narrow down the difference: For some reason, LibreOffice was word-wrapping one of the URLs differently (see attached file for a minimal working example).

In MS Word, it wraps the URL "https://www.netscout.com/sites/default/files/2019-03/SECR_005_EN-1901%E2%80%93WISR.pdf" right after "/2019-". But in LibreOffice, it wraps the URL after "/SECR_005_EN-", which pushes it onto an additional line. I'm not sure if this is intentional behaviour or not (feel free to close this issue if there's some existing reason why LibreOffice word wrap works this way).

This doesn't seem to be related to the fact that it's formatted as a hyperlink. If I leave the URL in plain text, the same word wrap difference happens.

My version of Word is 2003, but I tried it out with Word Online (Office 365) as well, and the behaviour here is the same as with Word 2003.

(Just as a point of reference, I tried out what Google Docs does, and it just doesn't wrap the URL on any hyphens at all. The URL just gets pushed onto a second line and it gets wrapped on the very last character in the line.)
Comment 1 Dieter 2020-03-17 15:34:51 UTC Comment hidden (obsolete)
Comment 2 Buovjaga 2020-05-10 20:27:37 UTC Comment hidden (obsolete)
Comment 3 Ahiijny 2020-05-10 21:24:22 UTC
> So for me, the bug is something like: "Hyperlink always starts in a new
> line, if it doesn't fit the line with text" Do you agree?

I think that's accurate, yes. Because of this behaviour in LO, sometimes the text in LO takes up more lines than the text in MS Word.

> BTW: You should never wrap the URL after a hyperlink, because it's not clear, if the hyphen is part of the URL or not.

You have a point. But both LO and MS Word seem to already do this to some extent though, so I don't know what to do about that...
Comment 4 QA Administrators 2020-05-11 03:46:29 UTC Comment hidden (obsolete)
Comment 5 Dieter 2020-05-11 07:04:52 UTC
Thinking about this issue I think, that word wrap behaviour of hyperlinks is quite unclear and I don't now if there is a certain rule within LO.

I would expect
- that it starts in the current line
- that word doesn't wrap after a hyphen

So in general: It would be perfect, if LO could follow for example CMOS (Chicago Manual of Style): https://www.chicagomanualofstyle.org/qanda/data/faq/topics/URLs/faq0008.html

I'm not sure about desired behaviour.
cc: Design-Team (not sure, if it is a a topic for it, but I also think, some more input is needed)
Comment 6 Heiko Tietze 2020-05-11 08:12:56 UTC
Consistency with Microsoft is prime but simply introducing their link wrap behavior might be a regression for open documents. So I would introduce an option "[ ] Wrap hyperlinks" (off by default) and when on, the hyperlink starts inline and breaks like MSO does. Not sure if they follow the CMOS. If we want this too, we should use a dropdown "Link wrapping: [Avoid line breaking] [Break at any character] [Break only after http://]. Sounds a bit over-engineered to me and I would do the simple MSO compatibility thing (also since GDocs does something else).
Comment 7 QA Administrators 2022-05-12 06:13:40 UTC Comment hidden (obsolete, spam)
Comment 8 Timur 2022-05-12 14:59:00 UTC
No repro 5.4, repro 6.0 and 7.4+. Also for DOCX. 

And bibisect points to an upgrade, like in bug 133607 (no point to put committer):
commit 172bc3741d6b8ba66763592086a7532437649e12
Date:   Mon Nov 20 20:07:52 2017 
    source 9206a08ada00e8762c4a634f242bd566028964bb
    pre a8687041c46b3fe93a76faa0a4a65e7069ef5e9d
Upgrade to ICU 60.1

This would require an analysis and maybe a report to Unicode as in bug 116400.
Comment 9 BogdanB 2022-12-04 19:58:32 UTC
Eike, I added you here, being related to 'Upgrade to ICU 60.1'.
Comment 10 Eike Rathke 2022-12-05 14:28:41 UTC
(In reply to Timur from comment #8)
> And bibisect points to an upgrade, like in bug 133607 (no point to put
> committer):
> commit 172bc3741d6b8ba66763592086a7532437649e12
No such commit.. probably meant was commit 9206a08ada00e8762c4a634f242bd566028964bb instead.

That includes a change
https://gerrit.libreoffice.org/c/core/+/44871/4/i18npool/source/breakiterator/breakiterator_unicode.cxx#547
on purpose, see its comment there.

Make that optional or remove it entirely if you want or fiddle with the nOverlyLong value or test for more than whitespace while finding another break position; IIRC there was a testcase looking for not breaking after a / slash, which apparently exactly changed with TR14 to break after the slash and not before, hence I introduced that non-wrapping code. Personally I think not wrapping URIs at slashes (or at all) if possible is better, but if people want it..
Comment 11 Heiko Tietze 2023-05-22 07:01:18 UTC
*** Bug 155088 has been marked as a duplicate of this bug. ***
Comment 12 Heiko Tietze 2023-05-22 07:06:51 UTC
In case of ordinary text it's always possible to add a line break but for fields, in particular for the bibliography as reported at bug 155088, it's not possible. Would treat this as a highly important enhancement.

MSO does the same as LibreOffice, at least for ordinary paragraphs.