Applying style to parent element in TinyMCE

Viewed 409

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?

1 Answers
Related