Last active
October 12, 2015 23:57
-
-
Save SamMarkiewicz/4106538 to your computer and use it in GitHub Desktop.
Removes <p> around <img> for Tumblr text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the var according to your needs : | |
var wrappedImg = $('[higher-selector-that-contains-img]').find('img') | |
wrappedImg.closest('p > *').unwrap(); //Allow p suppression even if the structure changes - i.e if you put link on your img | |
// Exemple : | |
// var wrappedImg = $('section').find('img') | |
// wrappedImg .unwrap('p'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment