Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Gae24 committed Oct 19, 2024
1 parent d445228 commit 52ce714
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,15 @@ impl<'clipboard> Get<'clipboard> {
}

pub(crate) fn html(self) -> Result<String, Error> {
let _clipboard_assertion = self.clipboard?;

let format = clipboard_win::register_format("HTML Format")
.ok_or_else(|| Error::unknown("unable to register HTML format"))?;

let mut out: Vec<u8> = Vec::new();
clipboard_win::raw::get_html(format.get(), &mut out)
.map_err(|_| Error::unknown("failed to read clipboard string"))?;

String::from_utf8(out).map_err(|_| Error::ConversionFailure)
}

Expand Down

0 comments on commit 52ce714

Please sign in to comment.