Closed q2apro closed 10 years ago
See also screenrecording:
I don't have MS word, I only have writer.
Get me a screenshot of the source HTML (using the browser's DOM inspector) right after you copy from MS word to SCE. Don't forget to fully extend the DOM tree. Then give me a copy of the contents that appear when you press to see the source code in SCE.
If Sam has MS word, then he might be able to assist on that.
The source HTML in SCeditor right after the paste and hitting the source button:
<!-- [if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif] -->
<p class="MsoNormal">
Interviu: „Patirtis, žinios bei kruopštus rankų darbasdažnai daro stebuklus“.
</p>
<!-- [if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif] -->
<!-- [if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif] -->
Also show me the source HTML before hitting the source button please.
Before hitting the source button:
<body dir="ltr" contenteditable="true"><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<p class="MsoNormal">Interviu: „Patirtis, žinios bei kruopštus rankų darbas
dažnai daro stebuklus“.</p>
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]--></body>
As I see now there is a line break instead a space after the word darbas
.
Sounds like that, yes. but... Where does that line come from?
Try with other browsers... Try chrome, for example. Do you have the same result?
How about if you explicitly place a new line on that spot in the word document? Does it create a <br>
when you paste to SCE?
How about with different texts? Try changing the sizes of the words. Does this repeat? Does that new line have any relation with the line wrapping of MS Word?
If you do, then the one with the bug is probably MS word and not SCE.
Before I dive into it more, is there a plain-text option of SCE? I have only seen that option with the bbcode plugin.
If not, maybe we could use some jquery like stated here: http://jsfiddle.net/erikwoods/Ee3yC/ or like here: http://stackoverflow.com/a/17545260/1066234
PS: Side note: If enablePasteFiltering: true
then the replacement of the spaces takes place immediately.
You mean... Plain text paste? You may make one, if you want, as a command. It should be straight forward. You may also paste the contents in the source code mode.
Looks like one year ago someone had a similar issue with Word 2010 and Firefox + Chrome: https://github.com/samclarke/SCEditor/issues/88 (closed as solved) - but the bug still exists.
PS: We really need a paste-as-plain-text option.
Which version of SCE are you using? (just checked... Some build of 1.4.5)
Try using the latest version and see if that still remains.
I am using 1.4.5.
I have also tried with latest 1.4.6-dev - still the same problem.
Thanks for reporting! Fixed in the 1.4.6-dev branch which I'm hoping to release fairly soon.
Fix confirmed.
PS: How I love these fixes that require only one char to be added, esp. if it is a white space! ;-)
My users recently discovered that copying and pasting text from Word or Open Office into the SCEditor will remove some arbitrary (?) white spaces.
To reproduce it:
darbas
anddažnai
is missing nowExample text:
Tested on: Win 7 (64 Bit), Word 2003, Firefox 31.0
How to solve this bug?
Is there a workaround, can I force paste as plain text somehow (I'm using the HTML plugin, not the bbcode)?