From 4d8584f427863fd3bed176808b82e38379c41147 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 15 Aug 2016 11:19:10 -0400 Subject: [PATCH] FIX: Support `div dir=` in sanitizer --- app/assets/javascripts/pretty-text/white-lister.js.es6 | 1 + test/javascripts/lib/sanitizer-test.js.es6 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/assets/javascripts/pretty-text/white-lister.js.es6 b/app/assets/javascripts/pretty-text/white-lister.js.es6 index c293b18135e..9c3a85439a0 100644 --- a/app/assets/javascripts/pretty-text/white-lister.js.es6 +++ b/app/assets/javascripts/pretty-text/white-lister.js.es6 @@ -124,6 +124,7 @@ whiteListFeature('default', [ 'div.quote-controls', 'div.title', 'div[align]', + 'div[dir]', 'dl', 'dt', 'em', diff --git a/test/javascripts/lib/sanitizer-test.js.es6 b/test/javascripts/lib/sanitizer-test.js.es6 index dd3fd47323d..0722fdb2363 100644 --- a/test/javascripts/lib/sanitizer-test.js.es6 +++ b/test/javascripts/lib/sanitizer-test.js.es6 @@ -56,6 +56,8 @@ test("sanitize", function() { cooked(`JS`, `

JS

`); cooked(`
Forum
Software
`, `
Forum
Software
`); cooked(`high low HUGE`, `

high low HUGE

`); + + cooked(`
RTL text
`, `
RTL text
`); }); test("ids on headings", () => {