Closed maroswal closed 1 month ago
Did you test will this fix it?
private static final PolicyFactory HTML_STYLES_SANITIZER = Sanitizers.STYLES
.and(new HtmlPolicyBuilder()
.allowElements("table", "span", "li", "p", "pre", "div", "hr")
.allowAttributes("class", "style", "contenteditable")
.onElements("table", "span", "li", "p", "pre", "div", "hr")
.toFactory());
Yes that's the way I fixed it with a monkey patch, but I haven't investigated if there are other elements with the same issue.
Nice i will add it. As a stopgap you can always set allowStyles="true"
to turn off that 1 setting in the SunEditor.
You're right, haven't thought about that option 😀
13.0.12 released
Describe the bug
In SunEditor you can set different table styles (min width, max width and fixed with) but the added style classes will be removed from the HtmlSanitizer.
Reproducer
No response
Expected behavior
Either make the HtmlSanitizer somehow configurable or add table elements to the styles sanitizer to keep the applied table styles.
PrimeFaces Extensions version
13.0.11
JSF implementation
Mojarra
JSF version
2.3
Browser(s)
No response