Re: PSA: HTML fragment mode interaction between Chromium, Clipboard & Notepad++

Maria Sophia <[email protected]> Tue, 10 Feb 2026 07:32:36 -0500
Newsgroups alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <[email protected]>
Maria Sophia wrote:
> The workaround I've come up with is surprisingly simple: 
> a. Insert an extraneous leading blank line at the top of the document
> b. Now when you press Ctrl+A, the selection works as expected
> c. Copy (Ctrl+C) or Cut (Ctrl+V) the selected text, as desired
> d. Then delete the extraneous leading blank line

Ooops... 
I had meant "Ctrl+X" above in item (c).
Working as a team, can you let me know if you can reproduce this easily?

1. Open Microsoft Edge (or any Chromium-based web browser).
2. Go to any web page, for example:
   Win+R > msedge https://en.wikipedia.org/wiki/Quotation_mark
3. Select any text on the page (e.g., Ctrl+A)
4. Press Ctrl+C to copy whatever text you had selected
5. Open Notepad++
6. Press Ctrl+V to paste the text
7. Now press Ctrl+A
Huh? You will see the selection flash, but nothing is selected.

This is the "HTML fragment mode" issue described above. 

Apparently, this artifact happens because Chromium puts hidden HTML on the
clipboard, and Notepad++ reacts to that by entering a special mode where
Ctrl+A and Ctrl+X do not work.

Please try it because maybe it's just me, but I've been battling this
artifact for a long time because it's completely hidden in a hex editor.

One false trail that sent me off the scent was that I had originally
suspected this problem was related to the BOM indicator in the
bottom-right corner of Notepad++. It is not. The BOM only tells us what
encoding Notepad++ will use when saving the file. It does not affect how
pasted text behaves.

The HTML fragment mode problem happens even when:
a. the file is brand new
b. the file has never been saved
c. the encoding is "ANSI" or "UTF-8" with no BOM
d. there is no BOM in the file at all

This artifact is caused entirely by the clipboard data format that Chromium
applications place on the Windows clipboard. Notepad++ sees the hidden HTML
version and enters HTML fragment mode. The BOM is not involved in any way.

I've always said I never quite understood all this character set stuff...
-- 
The nice thing about Usenet is you get good ideas from everyone.