File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
- Added better handling for undefined template fields, which will now be prompted for.
14
14
- Added support for the [ ` snacks.picker ` ] ( https://github.com/folke/snacks.nvim/blob/main/docs/picker.md ) picker
15
15
- Added support for the [ ` blink.cmp ` ] ( https://github.com/Saghen/blink.cmp ) completion plugin.
16
+ - Added support ` text/uri-list ` to ` ObsidianPasteImg ` .
16
17
17
18
### Changed
18
19
Original file line number Diff line number Diff line change @@ -40,7 +40,13 @@ local function clipboard_is_img()
40
40
-- See: [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme)
41
41
local this_os = util .get_os ()
42
42
if this_os == util .OSType .Linux or this_os == util .OSType .FreeBSD then
43
- return vim .tbl_contains (content , " image/png" )
43
+ if vim .tbl_contains (content , " image/png" ) then
44
+ return true
45
+ elseif vim .tbl_contains (content , " text/uri-list" ) then
46
+ local success =
47
+ os.execute " wl-paste --type text/uri-list | sed 's|file://||' | head -n1 | tr -d '[:space:]' | xargs -I{} sh -c 'wl-copy < \" $1\" ' _ {}"
48
+ return success == 0
49
+ end
44
50
elseif this_os == util .OSType .Darwin then
45
51
return string.sub (content [1 ], 1 , 9 ) == " iVBORw0KG" -- Magic png number in base64
46
52
elseif this_os == util .OSType .Windows or this_os == util .OSType .Wsl then
You can’t perform that action at this time.
0 commit comments