Allow element nested inside specific element

44 views
Skip to first unread message

ma...@pharmgkb.org

unread,
Aug 25, 2016, 4:53:01 PM8/25/16
to OWASP Java HTML Sanitizer Support
Is it possible to allow a certain element (<br>) if it is nested in another specific element (<table>)? i.e. breaks are allowed only within table tags else they are rejected.

Mike Samuel

unread,
Aug 26, 2016, 4:26:17 PM8/26/16
to OWASP Java HTML Sanitizer Support
No mechanism currently.
You could also do this in CSS though.
If you wrapped all third party content in <div
class="third-party-content>...</div> then

<style>
.third_party_content br:before {
content: ' ';
white-space: normal;
}

.third_party_content table br:before {
content: "\A"; white-space: pre-line
}
</style>

might do it.
> --
> You received this message because you are subscribed to the Google Groups
> "OWASP Java HTML Sanitizer Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to owasp-java-html-saniti...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

ma...@pharmgkb.org

unread,
Aug 29, 2016, 7:27:28 PM8/29/16
to OWASP Java HTML Sanitizer Support, mikes...@gmail.com
Ok. Thanks for your response.
Reply all
Reply to author
Forward
0 new messages