<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Webkit adds multiple &nbsp; to HTML pasted into contenteditable element."
href="https://bugs.webkit.org/show_bug.cgi?id=154676">154676</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Webkit adds multiple &nbsp; to HTML pasted into contenteditable element.
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari 9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>HTML Editing
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>j.swiderski@cksource.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=272201" name="attach_272201" title="Sample page which shows how browsers sees HTML.">attachment 272201</a> <a href="attachment.cgi?id=272201&action=edit" title="Sample page which shows how browsers sees HTML.">[details]</a></span>
Sample page which shows how browsers sees HTML.
Safari Version : 9.0.3 (11601.4.4)
Other browsers tested:
Chrome: Fail, version: 48.0.2564.116 m
Firefox: OK
IE: OK
----
What steps will reproduce the problem?
1. Open attached sample in a browser.
2. Go to <a href="https://en.wikipedia.org/wiki/HTTPS">https://en.wikipedia.org/wiki/HTTPS</a> and copy first paragraph (from HTTPS to <a href="https://en.wikipedia.org/wiki/HTTPS">https://en.wikipedia.org/wiki/HTTPS</a>)
3. Paste it in editable element, click the "Get HTML" button and observe what HTML gets produced.
----
What is the expected result?
The expected HTML is without &nbsp; being inserted before closing and after opening span tag.
If I go to <a href="https://en.wikipedia.org/wiki/HTTPS">https://en.wikipedia.org/wiki/HTTPS</a> and execute below in console everything seems to be in order
console.log(document.getElementById('mw-content-text').getElementsByTagName('p')[0].innerHTML);
Also viewing HTML with dev-tools doesn't show any &nbsp;
----
What happens instead?
There are &nbsp being inserted before closing and after opening span tag.
Please provide any additional information below. Attach a screenshot if possible.
I have tested this on Windows 7 and Mac 10.11</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>