RetconHTML-Craft
RetconHTML-Craft copied to clipboard
pseudo selectors?
Hi there, thank you for your plugin, it is very useful and I use it almost in every project I work on.
I have a question about how to use selectors.
I'm trying to append an attribute via retcon filter, but though I'm able to make it work for the first element in the array (it appends the class 'img-responsive' to img tag in entry.body) I'm not able to append another attribute to a subset of another element (all a tag with no rel attribute):
{{ entry.body | retcon( [ ['attr', 'img', { 'class' : 'img-responsive' }], ['attr', 'a:not[rel]', {'data-lightbox' : 'article-'~entry.slug}] ]) }}
Am I approaching in the wrong way? Any suggestions? Thanks in advance!