Browsers differ in what they return as the content of a visually empty rich text area (RTA). Accordingly, RTA sanitizes these different values ensuring an empty string is returned to the framework. However, existing sanitization criteria doesn't work for Firefox 74 and Internet Explorer 11.
This fix appends the sanitization criteria of Firefox 74 and IE 11, ensuring an empty string is returned to the framework for a a visually empty RTA.
Closes #10338
BrowserInfo browser = BrowserInfo.get();
String result = getValue();
if (browser.isFirefox()) {
- if ("<br>".equals(result)) {
+ if ("<br>".equals(result) || "<div><br></div>".equals(result)) {
result = "";
}
} else if (browser.isWebkit() || browser.isEdge()) {
result = "";
}
} else if (browser.isIE()) {
- if ("<P> </P>".equals(result)) {
+ if ("<P> </P>".equals(result) || "<p><br></p>".equals(result)) {
result = "";
}
} else if (browser.isOpera()) {