Question

Here is a amazing webpage : Go there

Now, copy a part of the text, for instance, this block :text on the website

And now, paste-it on Notepadd++ (others editor seems not to work for that). Here is a screenshot of the result :same text pasted on Notepadd++

How is this possible? Are there any dashes which cannot be printed on a webpage, but copy-able? I have heard about Copy Protection with JS, but here, I am very surprised...

Any idea about how this is implemented?

Was it helpful?

Solution

It's Soft-Hyphen, an hyphenation authorization. To remove it, try:

strtr($text, array("\xC2\xAD" => "")); // If you are in UTF-8
strtr($text, array("\xAD" => "")); // ISO 8859-1
str_replace('­', '', $text); // html

Let's see in OpenOffice:enter image description here

OTHER TIPS

The page is using Soft hyphens:

In computing and typesetting, a soft hyphen (U+00AD soft hyphen, HTML: ­ ­), also called a discretionary hyphen or optional hyphen, is a kind of hyphen used to specify a place in text where a hyphenated break is allowed without forcing a line break in an inconvenient place if the text is re-flowed.

The soft hyphen will not display unless the browser decides to break the line at that character.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top