Created
January 11, 2023 05:00
-
-
Save mavaddat/3ad0d28cf3b4b3c864a0bd31241a4e46 to your computer and use it in GitHub Desktop.
Get Clipboard HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Windows.Forms.Clipboard]::GetData("HTML Format") | ForEach-Object { $_ -replace '(?:<!--[^>]*-->|</?(html|body)>)' -split "`n"} | Select-Object -Skip 8 -First 1 | ForEach-Object { $_ -replace '<(\S+)[^>]*>','<$1>'} | Set-Clipboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment