Issue with pasting text in writer

Hi, i’m trying to copy a few lines from a website and paste it into the writer but i keep getting this weird pattern:

I’ve tried pasting it with all different options, furthermore, I have also tried copying the text dirctly out of the websites source code. It always ends up looking like this and it only ends up looking like this in libreoffice-writer; the text looks fine when I paste it into editor. Can someone explain why this is happening and how I can fix it? Thanks in advance.

1 Like

Hard to tell from just an image but it seems you are getting some style information from the website. Have you tried Paste Special and choose unformatted text?
Can yu give a link to the particular web page? I tried a search but got too many results to look at all.

1 Like

Yes, i have tried that. It doesn’t change it. Here is the website: link text

My guess is that the website uses UTF-8 character set which doesn’t work nicely with LibO as we have it configured. I did manage to successfully copy from the source - that gave me HTML tags as well but ‘clean’ text. I’m not sure what the definitive solution is, however.

It’s the ­ HTML element inserted between each and every syllable by the web designer/developer. See my comments below the answer for more info.

A note to OP: besides screenshots, it is good to describe exactly what you feel “weird”: omitting it may make people guess what was that, like above: was that center-alignment, or was that soft hyphens? Please next time be more verbose.

Thank you for the answers. Sure, I’ll try to be more specific next time. truth to be told; I didn’t even know that those things were called soft hyphens.

truth to be told; I didn’t even know that those things were called soft hyphens

That was just an advise for the future; and we naturally ask when we don’t know ourselves. It’s OK to write something like “those grey-shadowed thingies on screenshot” :slight_smile:

Thanks, that works.

Below is an image showing easy steps to remove the soft hyphens within LibreOffice Writer. Open the Find & Replace dialog (CTRL+H or COMMAND+H) and follow the steps. In case it’s hard to read in the image, the text in the Find box is \xAD. Yes, that’s a backslash at the beginning.

Obviously your interface will vary slightly if you are working in German or another OS. Don’t forget to uncheck Regular expressions after you are done removing the soft hyphens, otherwise you might get unexpected results on your next Find & Replace operation.

On your linked German website, Inspect Element by right-clicking on a paragraph using Chrome browser’s developer tools, and you can see the entities littering the code. Ew…

1 Like

More specifically, this website makes use of a jQuery plugin called Hyphenator 4.2.0, which inserts these soft hyphens programmatically. Again, I think it’s a mistake, but to each his/her own I guess. Pointless overhead to cycle through EVERY word on the page when loading pages for a feature that doesn’t serve an important or meaningful purpose. Perhaps the designer is REALLY into typography or something. :slight_smile:

Searching for regex \xAD does the job.

Good one, @mikekaganski. That would be just as easy if not more so, especially on a machine that doesn’t support ALT+ codes. I’ll update the answer to make it easier for others.

Thank you a lot for your comment! I checked the code with firefox but it didn’t show me those “&shy” expressions - then again; maybe I just looked at the wrong place. Anyway, thanks.

Indeed. I did the same. Chrome seems to work better for this particular oddity. I was disappointed that Firefox didn’t show them because it is my preferred browser. Oh well. They are indeed in the code though. The jQuery library plugin adds them as/after the page loads, which is cool because then if viewing on a phone, you can lose a bit more battery life while Javascript and CSS do their “invaluable” hyphenation :slight_smile: The extra jQuery also adds to the page download size. Yay.

Sorry, don’t mind me. I’m a verbose, former web designer/developer. :smiley:

lmao, I like you

I’m ­ - don’t make me blush.

The text pastes riddled with soft hyphens. You can’t do much about this except for removing them (with a macro, for example). However, why bother?

looks fine when I paste it into editor.

Which editor do you mean? Most probably, the editor just can’t display soft hyphens correctly.

This is an artifact of the HORRIBLE idea of the $shy; HTML entity that this website is using. The web coder has an unhealthy fixation on supporting hyphenation. Completely pointless since it ruins clean text for the sake of a feature that only a few browsers support anyway. Inserting invisible html entities between every syllable is awful and probably has numerous bad consequences! Nothing to do with LibreOffice, it’s a problem specific to this website because of their coding practice.