Bug 155088 - Hyperlinks have line break inserted before them
Summary: Hyperlinks have line break inserted before them
Status: RESOLVED DUPLICATE of bug 131278
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Hyperlink
  Show dependency treegraph
 
Reported: 2023-04-30 11:29 UTC by dolezvo1
Modified: 2023-05-22 07:01 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of urls being broken up strangely (42.66 KB, application/vnd.oasis.opendocument.text)
2023-04-30 11:30 UTC, dolezvo1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dolezvo1 2023-04-30 11:29:00 UTC
Description:
It appears as though hyperlinks have line break inserted before them if they don't fit the current line. That just doesn't look right, and if this isn't a bug, a way to disable this should be avaiable. See the attachment for a clearer picture.

Steps to Reproduce:
Above

Actual Results:
Above

Expected Results:
Above


Reproducible: Always


User Profile Reset: No

Additional Info:
No
Comment 1 dolezvo1 2023-04-30 11:30:02 UTC
Created attachment 187012 [details]
Example of urls being broken up strangely
Comment 2 Dieter 2023-05-10 18:54:37 UTC
I can see the problem, but I have no idea about expected result. Dolezvo1, what is your idea (reduce font size, expand frame size, ...)?
=> NEEDINFO
Comment 3 dolezvo1 2023-05-10 19:09:36 UTC
To be honest I don't remember the details perfectly, but if it isn't hardcoded to enter a newline before URL in some circumstances, then it seems like a symptom that the line breaking isn't smart enough when breaking URLs.

If I am not mistaken, according to this (https://www.unicode.org/reports/tr14/), solidus should be break opportunity in URLs. However it seems to me the only break opportunity that is currently ever used in URLs is the hyphen (possibly because breaking algorithm might not be differentiating URLs from text).
Comment 4 QA Administrators 2023-05-11 03:19:11 UTC Comment hidden (obsolete)
Comment 5 Dieter 2023-05-18 16:30:26 UTC
(In reply to dolezvo1 from comment #3)
> If I am not mistaken, according to this
> (https://www.unicode.org/reports/tr14/), solidus should be break opportunity
> in URLs. However it seems to me the only break opportunity that is currently
> ever used in URLs is the hyphen (possibly because breaking algorithm might
> not be differentiating URLs from text).

Hyphen is definitley not a coud idea, because it could be misinterpreted as part of the hyperlink.
Comment 6 dolezvo1 2023-05-18 16:40:13 UTC
No, you're misunderstanding. The way it *currently* works is that it breaks the line when there is a hyphen in the link, not (as far as I am aware) in any other case.

For example https://example.com/items/item-one/picture-three.png might get broken as:


words words words https://example.com/items/item-one/picture-
three.png words


I don't see any real issue with breaking on hyphen, however in many cases the link would better fit broken up like this:


words words words https://example.com/
items/item-one/picture-three.png words


This, however doesn't happen naturally, and *that* is my issue. Even worse, it is not uncommon to see something as hideous as this:


words words words
https://example.com/items/itemone/
picturethree.png words
Comment 7 Dieter 2023-05-21 13:05:54 UTC
Sorry, but I only had a look at example in attachment 187012 [details] and I couldn't see a hyphen there.

As far as I can see, problem is not related to text boxes. Just copy URL from attachment and paste it in regular text area. Reduce text with t let's say 7 cm and URL breaks.

So I see the more general question: How should LO handle with hyperlinks longer than line whidth.

Let's ask design-team
Comment 8 Heiko Tietze 2023-05-22 07:01:18 UTC
I would manually break a hyperlink at any of the slashes but in case of fields it's not possible. The problem has been reported before and I make this a duplicate to draw more attention on it.

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