mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 23:38:09 +08:00
FEATURE: whitelist data for themes
This commit is contained in:
@ -137,7 +137,12 @@ const DEFAULT_LIST = [
|
|||||||
'div.quote-controls',
|
'div.quote-controls',
|
||||||
'div.title',
|
'div.title',
|
||||||
'div[align]',
|
'div[align]',
|
||||||
'div[data-theme-*]',
|
'div[data-*]', /* This may seem a bit much but polls does
|
||||||
|
it anyway and this is needed for themes,
|
||||||
|
special code in sanitizer handles data-*
|
||||||
|
nothing exists for data-theme-* and we
|
||||||
|
don't want to slow sanitize for this case
|
||||||
|
*/
|
||||||
'div[dir]',
|
'div[dir]',
|
||||||
'dl',
|
'dl',
|
||||||
'dt',
|
'dt',
|
||||||
|
@ -1262,4 +1262,9 @@ HTML
|
|||||||
HTML
|
HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "has a proper data whitlist on div" do
|
||||||
|
cooked = PrettyText.cook("<div data-theme-a='a'>test</div>")
|
||||||
|
expect(cooked).to include("data-theme-a")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user