text copied from iOS fields has spaces replaced with   when pasted
| Originator: | mike | ||
| Number: | rdar://11345383 | Date Originated: | 30-Apr-2012 09:15 AM |
| Status: | Open | Resolved: | |
| Product: | iPhone/iPod touch | Product Version: | 5.1 (9B176) |
| Classification: | Other bug | Reproducible: | Always |
Summary: Text copied from any iOS multi-line text field and then pasted into a web form text area has its spaces replaced with  <space>. Causes interference with space-significant text such as Markdown or Python
Steps to Reproduce:
1. enter text into an app, such as the built-in Notes app as follows:
"Some Text
Some code
some more code
Some more text"
(note that the 2 indented 'code' lines are indented with 4 spaces)
2. Select and copy all of the text
3. John Gruber's Markdown Dingus is a handy test bed, load http://daringfireball.net/projects/markdown/dingus in Mobile Safari
4. Paste the copied text into the "Markdown source" text area and press the "Convert" button
5. See "HTML Source" text area for results and below.
Expected Results:
The above text *should* produce the following HTML:
<p>Some Text</p>
<pre><code>Some code
some more code
</code></pre>
<p>Some more text</p>
The indented lines are wrapped in <pre><code> tags.
Actual Results:
This is the html produced instead:
<p>Some Text</p>
<p> Some code
some more code</p>
<p>Some more text</p>
because the spaces have been replaced with a space and a non-breaking space htmlentitiy, the spaces are not correctly interpreted by Markdown.
Regression:
I have tested this with my iPhone 4 and The New iPad, both behave this way every time.
Notes:
If you paste the text and manually delete/replace the spaces before submitting the form, it works normally.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!