You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTML sanitizer is converting the font names in 'style' attribute of HTML element to lower case.
This results in content rendered not using right font.
Sample Input : <p><span style="font-family:Times New Roman,Times,serif;">fourth line</span></p>
Expected Output: <p><span style="font-family:'Times New Roman' , 'Times' , serif">fourth line</span></p>
Actual output : <p><span style="font-family:'times new roman' , 'times' , serif">fourth line</span></p>
Use following code to reproduce : public void testLowerCasingOfFont() { String text = "<p><span style=\"font-family:Times New Roman,Times,serif;\">text</span></p>"; String output = new HtmlPolicyBuilder().allowStyling().allowElements("p", "span").allowAttributes("style").onElements( "p").toFactory().sanitize(text); System.out.println(output); }
The text was updated successfully, but these errors were encountered:
HTML sanitizer is converting the font names in 'style' attribute of HTML element to lower case.
This results in content rendered not using right font.
Sample Input :
<p><span style="font-family:Times New Roman,Times,serif;">fourth line</span></p>
Expected Output:
<p><span style="font-family:'Times New Roman' , 'Times' , serif">fourth line</span></p>
Actual output :
<p><span style="font-family:'times new roman' , 'times' , serif">fourth line</span></p>
Use following code to reproduce :
public void testLowerCasingOfFont() { String text = "<p><span style=\"font-family:Times New Roman,Times,serif;\">text</span></p>"; String output = new HtmlPolicyBuilder().allowStyling().allowElements("p", "span").allowAttributes("style").onElements( "p").toFactory().sanitize(text); System.out.println(output); }
The text was updated successfully, but these errors were encountered: