home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.comp.os.windows-10      Steaming pile of horseshit Windows 10      197,590 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 197,281 of 197,590   
   Maria Sophia to All   
   Re: PSA: HTML fragment mode interaction    
   10 Feb 26 09:07:03   
   
   XPost: alt.comp.os.windows-11, alt.comp.microsoft.windows   
   From: mariasophia@comprehension.com   
      
   > Maria Sophia wrote:   
   >   
   >> When you copy text from any Chromium-based application, Apparently Windows   
   >> does not just copy plain text. Windows actually puts two versions of the   
   >> text on the Windows clipboard:   
   >> 1. a normal plain-text version   
   >> 2. a hidden HTML-formatted version   
   >   
   > Not uncommon for many apps to make multiple formats avaailable on the   
   > clipboard.   
   >   
   >> When we paste that clipboard data into Notepad++, Notepad++ sees the hidden   
   >> HTML version and Notepad++ assumes the paste is part of a larger HTML   
   >> fragment. That puts Notepad++ into a strange internal state, which is   
   >> apparently sometimes called "HTML fragment mode".   
   >   
   > I think notepad++ has a "paste special" command, does that let you pick   
   > the plain text version?   
      
   Thanks for trying to help out, Andy, as I respect your knowledge and that   
   of Paul, Carlos, and others, as I will always be open when I say I never   
   really understood this stuff but I need to fix it with my Notepad++ macro.   
      
   One of the first things I tried was Control+Shift+V and the Notepad++ hex   
   editor, but neither seemed to help so I gave up on both of them long ago.   
      
   Notepad++'s "Paste Simple Text" command only works if the clipboard   
   actually contains a plain-text flavor that Notepad++ recognizes as usable.   
      
   Chromium does put plain text on the clipboard but there's a catch.   
   Chromium puts the HTML flavor first & marks it as the "preferred" format.   
      
   Even when we use Paste Simple Text, Notepad++ still has to ask Windows for   
   the available formats. If Windows reports the HTML flavor as the "best   
   text-like format," Notepad++ may still pick it.   
      
   Given that inconsistency, it seems...   
    a. Ctrl+V always triggers HTML fragment mode   
    b. Ctrl+Shift+V sometimes still triggers HTML fragment mode   
   The only guaranteed way to break the mode is to modify the buffer (i.e.,   
   insert/delete a line).   
      
   My issue is I can't fix it in my Notepad++ macro until I understand it.   
   And to understand it, I'd like to *see* it. But it's invisible!   
      
   Oddly, I don't see this problem with Mozilla browsers.   
   Just Chromium-based browsers.   
      
   Huh?   
      
   Interestingly, both Chromium and Firefox can place multiple formats on the   
   clipboard (plain text, HTML, images, etc.). That part is normal and very   
   old Windows behavior as Carlos astutely already noted in a prior post.   
      
   Chromium browsers (Edge, Chrome, Brave, Vivaldi, Electron apps) add extra   
   metadata to the HTML clipboard flavor, e.g., StartHTML, EndHTML,   
   StartFragment, EndFragment.   
      
   Notepad++ interprets this as a fragment boundary and enters "HTML fragment   
   mode." That's what breaks Ctrl+A and Ctrl+X.   
       
      
   Firefox does not add those fragment markers in the same way. It typically   
   places plain text and a simpler HTML representation without the   
   Chromium-style fragment metadata.   
       
      
   Go figure. Did I mention I never understood all this character stuff?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca