Jul 05, 2012; 22:00
Peter D Bethke
Regex for Pinterest LP85
Hello all,
For Lasso 8.5
I've been getting increased interest in allowing users of a CMS that I built which uses CKEditor to use Pinterest to tag images. I can't find a plugin for CKEditor that will allow easy input of Pinterest tags though - it has to be a pretty no-brainer to work for the site users.
Because CKEditor saves the html to the database which is then retrieved, I thought some kind of nifty Regex might scan through the html and pick out the images used there, and insert a Pinterest tag automatically - regex is not my strong suit though. The good news is though that because CKEditor is the one generating the html the format of the img tags will be largely uniform. I know for example that Doug B does a lot of regex stuff for his current API, on the fly - maybe something along those lines.
I spent the day trying to get various permutions of regex->find to pick up and pre-append all image tags with the Pinterest tag + the image tag, but its complicated by the fact that I need to grab both the src value from the image tag and the style value from it as well (to preserve the height and width attributes plus whatever else was applied to it in the CKeditor), and to use those values to reconstruct the image tag with the pre appended Pinterest tag.
No luck though. If anyone has any ideas I'd be most happy to hear them.
Best,
Peter
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>