OneMore
OneMore copied to clipboard
When using rich text paste, the spaces in the original text will disappear
Describe the bug
When copying code from idea series IDE and pasting it to OneNote, the default paste format of OneNote does not contain spaces, but has color information and font information.
After checking online, I found that installing a plugin can solve this problem. The "Paste Rich Text" feature in gem for onenote plugin can solve this problem perfectly, keeping spaces and retaining color and font information (but the interface of this software is not as good as OneMore and the fee is very high).
OneMore plug-in also has "Paste Rich Text" function, but it can't keep spaces, and the default format of OneNote paste is the same.
To Reproduce Steps to reproduce the behavior:
- Go to 'more'
- Click on 'edit'
- Click on 'Paste Rich Text'
- See error
Expected behavior Paste rich text and keep spaces when pasting.
Screenshots As shown in the above diagram.
Environment (if applicable):
- OneNote Version: 2021 MSO (version 2205 Build 16.0.15225.20278) 64 bit
- OneMore Version: 4.18
Additional context <one:Page xmlns:one="http://schemas.microsoft.com/office/onenote/2013/onenote" ID="{C4854877-D194-0423-27E5-FAE3AA437DF2}{1}{E19461629569653830105420144520017367855963141}" name="issue" dateTime="2022-06-28T09:16:35.000Z" lastModifiedTime="2022-06-28T09:21:37.000Z" pageLevel="2" isCurrentlyViewed="true" selected="partial" lang="zh-CN"> <one:QuickStyleDef index="0" name="PageTitle" fontColor="automatic" highlightColor="automatic" font="Cascadia Code" fontSize="20.0" spaceBefore="0.0" spaceAfter="0.0" /> <one:QuickStyleDef index="1" name="p" fontColor="automatic" highlightColor="automatic" font="Cascadia Code" fontSize="12.0" spaceBefore="0.0" spaceAfter="0.0" /> <one:QuickStyleDef index="2" name="p" fontColor="automatic" highlightColor="automatic" font="Cascadia Code" fontSize="12.0" spaceBefore="0.0" spaceAfter="0.0" /> <one:PageSettings RTL="false" color="automatic"> one:PageSize <one:Automatic /> </one:PageSize> <one:RuleLines visible="false" /> </one:PageSettings> <one:Title selected="partial" lang="en-US"> <one:OE alignment="left" quickStyleIndex="0" selected="partial"> one:T</one:T> <one:T selected="all"></one:T> </one:OE> </one:Title> one:Outline <one:Position x="36.0" y="86.4000015258789" z="0" /> <one:Size width="540.0" height="529.225830078125" /> one:OEChildren <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Microsoft YaHei';font-size:12.0pt"> one:Tthe correct paste (using paste rich text) (ideal situation) :]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt;color:#8C8C8C" lang="en-US"> one:T</one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:Tcreate table student(]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T id int auto_increment primary key comment '',]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T name varchar(10) comment '',]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T no varchar(10) comment '']]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T) comment '';]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:Tinsert into student values (null,'','2808100101'),(null,'','2000108102'),(null,'','2000100103' ) ,(null, '','2000100104');]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2"> one:T</one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:Tcreate table course(]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T id int auto_increment primary key comment '',]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T name varchar(10) comment '']]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:T) comment'';]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Cascadia Code';font-size:12.0pt" lang="en-US"> one:Tinsert into course values (null,'Java'),(null,'PHP'),(null,'MySQL'),(null,'Hadoop');]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Microsoft YaHei';font-size:12.0pt" lang="en-US"> one:T</one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Microsoft YaHei';font-size:12.0pt" lang="en-US"> one:T</one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Microsoft YaHei';font-size:12.0pt"> one:Tthe onenote and onemore (using paste rich text) did not reach the ideal state, because the spaces in the original text were not retained :]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="2" style="font-family:'Microsoft YaHei';font-size:12.0pt" lang="en-US"> one:T</one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tcreatetablestudent(]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tidintauto_incrementprimarykeycomment'',]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tnamevarchar(10)comment'',]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tnovarchar(10)comment'']]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:T)comment'';]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tinsertintostudentvalues(null,'','2808100101'),(null,'','2000108102'),(null,'','2000100103'),(null,'','2000100104');]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1"> one:T</one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tcreatetablecourse(]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tidintauto_incrementprimarykeycomment'',]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tnamevarchar(10)comment'']]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:T)comment'';]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Cascadia Code';font-size:12.0pt"> one:Tinsertintocoursevalues(null,'Java'),(null,'PHP'),(null,'MySQL'),(null,'Hadoop');]]></one:T> </one:OE> <one:OE alignment="left" quickStyleIndex="1" style="font-family:'Microsoft YaHei';font-size:12.0pt" lang="en-US"> one:T</one:T> </one:OE> </one:OEChildren> </one:Outline> </one:Page>
Looking forward to your reply, your software is of high quality.
This is a problem with the way IDEA copies rich content as HTML to the clipboard. Indeed, I can demonstrate that by using my ClipboardRtfToHtml converter which first dumps out all content formats stored in the Windows clipboard. This shows that IDEA writes significant whitespace chars as unwrapped "text" elements within the HTML instead of embedded in strings wrapped by SPAN elements.
This is acknowledged by JetBrains here and here
When you paste into OneNote using the built-in Paste function or Ctrl-V, OneNote first looks for HTML formatted content on the clipboard (before it looks for RTF formatted content) and inserts that. OneMore does the same.
There are a couple of solutions
- As a workaround, you can Paste as Plain Text and then use OneMore's Colorize command.
- I can change OneMore's search order to first look for RTF contents on the clipboard before it looks for HTML content. I'll have to think more about this since I'm not sure of the ramifications.
- I can try to preserve significant spaces between SPANs. Quite honestly, the Paste to Rich Text command is one that I've been meaning to "clean up" for some time. Perhaps now is the time!
Thank you very much for your patient response! Thank you!
should be fixed in next release.
IDEA was representing spaces as " " By replaces that sequence with actual spaces, the Paste as Rich Text seems to work just fine now.