Skip to content

Instantly share code, notes, and snippets.

@ankedsgn
Created May 12, 2020 11:47
Show Gist options
  • Save ankedsgn/8b50c3ddf6d841b6fc99ebb784005d3b to your computer and use it in GitHub Desktop.
Save ankedsgn/8b50c3ddf6d841b6fc99ebb784005d3b to your computer and use it in GitHub Desktop.
Inline ckeditor images
//Better inline images from the wysiwyg editor
if ($('.user-content img[style]').length > 0){
var inlineimg = $('.user-content img[style]');
console.log(inlineimg);
inlineimg.css("width","").css("height","");
}
// images in htlm field
// in custom.js, inline width and height is stripped
.user-content {
img[style*='float: right'] {
clear: both;
width: 100%;
margin: var(--vertSpace-sm) 0;
@include respond-to(small-screens) {
width: 50%;
margin: 0 0 var(--vertSpace-sm) var(--gutterWidth);
}
}
img[style*='float: left'] {
clear: both;
width: 100%;
margin: var(--vertSpace-sm) 0;
@include respond-to(small-screens) {
width: 50%;
margin: 0 var(--gutterWidth) var(--vertSpace-sm) 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment