Thanks for this! GREAT idea for a plugin!
I was using a v0.6 Sigil to paste from a website and build ePubs--and the images worked.
Once I loaded in Moon+ I noticed they were broken, and in Sigil v0.9.7 there are "Get failed - protocol HTTPS is unknown" errors (╥_╥)
I now need to fix 70+ images, so thanks! This will definitely help!
I have two usability questions:
1) Could PasteImage take the image URL, add it, AND Insert it at the cursor? That would simplify things by a lot!
2) Could PasteImage parse a clipboard with html info to keep the images, without the extra step?
From
https://translationchicken.com/2016/...their-oaths16/
Code:
<img src="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=1400"
class="attachment-baskerville-post-image size-baskerville-post-image wp-post-image"
alt="arc3interludeiii"
srcset="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=1400 1400w,
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=150 150w,
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=300 300w,
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=768 768w,
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=1024 1024w,
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png 1600w"
sizes="(max-width: 1400px) 100vw, 1400px" data-attachment-id="2919"
data-permalink="https://translationchicken.com/arc3interludeiii/"
data-orig-file="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png"
data-orig-size="1600,900" data-comments-opened="1"
data-image-meta="{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}"
data-image-title="arc3interludeiii" data-image-description=""
data-medium-file="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=300"
data-large-file="?w=736" width="1400" height="788"/>
</div>
<div class="post-content clear">
<h6 style="text-align:left;">*******Note from Translation Chicken*******</h6>
Sigil prompts asking if I want to paste Plaintext, I hit No, and so the text pastes correctly but the image is broken.
If this code was on the clipboard, could PasteImage be changed to paste it better?
Thanks again for a great plugin!