Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ Property forKey(String propertyName) {
Set<String> tableLayoutLiterals0 = j8().setOf(
"auto", "fixed", "inherit");
Set<String> textAlignLiterals0 = j8().setOf(
"center", "inherit", "justify");
"center", "end", "inherit", "justify", "justify-all", "match-parent", "start");
Set<String> textDecorationLiterals0 = j8().setOf(
"blink", "line-through", "overline", "underline");
Set<String> textTransformLiterals0 = j8().setOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,23 @@ public final void testHtmlPolicyBuilderDefinitionWithNoAttributesDefinedGlobally
new HtmlPolicyBuilder().allowElements().allowAttributes().globally().toFactory();
}

@Test
public final void testCSSTextAlign() {
HtmlPolicyBuilder builder = new HtmlPolicyBuilder();
PolicyFactory factory = builder.allowElements("span")
.allowAttributes("style").onElements("span").allowStyling()
.toFactory();

String toSanitizeTextAlignStart = "<span style=\"text-align:start\">start</span>";
assertEquals(toSanitizeTextAlignStart, factory.sanitize(toSanitizeTextAlignStart));

String toSanitizeTextAlignEnd = "<span style=\"text-align:end\">end</span>";
assertEquals(toSanitizeTextAlignEnd, factory.sanitize(toSanitizeTextAlignEnd));

String toSanitizeTextAlignFoo = "<span style=\"text-align:foo\">foo</span>";
assertEquals("foo", factory.sanitize(toSanitizeTextAlignFoo));
}

@Test
public final void testCSSFontSize() {
HtmlPolicyBuilder builder = new HtmlPolicyBuilder();
Expand Down