Embed Image HTML
Embed Image HTML

Script key: Embed Image HTML

Posted by Nick (@N00dles22)

Install

Details

Label Embed Image HTML
Voice Over Embed Image HTML
Script
// Embed html image at 100% width

var sel = getSelectedText();
var selRange = getSelectedRange();

if (!sel || sel.length == 0) {
  setSelectedText("<img src='' alt='img' width='100%' style='display: block; margin-left: auto;margin-right: auto'/>");
  setSelectedRange(selRange[0]+10,0);
}
else {
  setSelectedText("<img src='' alt='"+sel+"' width='100%' style='display: block; margin-left: auto;margin-right: auto'/>");
  setSelectedRange(selRange[0]+10,0);
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus