Issue with pasting text in writer

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.

It’s about as sensible as wrapping every single word or letter in <span></span> tags just in case you want to do something to them via CSS. Bad coding approach.

I suppose you could recommend an “improvement” to LO that, if such &shy; html entities are in clipboard text, that they be automatically stripped out on paste function. Here’s the unicode info on the character in case anyone is curious:

U+00AD : SOFT HYPHEN [SHY] {discretionary hyphen}

I meant WordPad not editor. I could paste it into a WordPad document without those soft hyphens showing or affecting the text in any way. I’m not sure why but I couldn’t find anything unusual in HTML while “inspecting” the page with firefox. Consequently, I was somewhat puzzled.
I don’t aim to fix the code on the website. It’s a college website; I was summarizing/copying some parts of its content for my own personal notes.

But just think, if you bring all these things to the university’s attention, they might offer you a great job on their web development team! :smiley: Don’t point them my way though. I don’t speak German, and I’m thoroughly burnt out with web design. I wish this forum had private messaging so I could not pollute the answers with all my stupid jokes. But then all the experts with mega karma would get spammed big-time with private message questions! :smiley: (I’m not one of those experts, just an average user)