I have a requirement to add a class to a p-tag if it has an a-tag child, like this:
<p class="read-more-link">
<a href="#">Link</a>
</p>
I've tried the following without success (this is C# in EPiServer):
new {title="Read more link", selector="p", classes="read-more-link" } // this allows user to add class to any p
new {title="Read more link", selector="p > a", classes="read-more-link" } // this adds class to a tag
new {title="Read more link", selector="p > a", classes="read-more-link", wrapper="true" } // this does nothing
new {title="Read more link", selector="p > a", block="p", classes="read-more-link", wrapper="true" } // this does nothing
new {title="Read more link", selector="a", block="p", classes="read-more-link", wrapper="true" } // this does nothing
Anyone know how to solve this?
` tag with the specified CSS classes _around_ any element selected in the editor. AFAIK there is no way to specify that a wrapper should only be available to wrap specific elements.
– Ted Nyberg Nov 10 '20 at 09:32